Quantcast
Channel: Active questions tagged r - Stack Overflow
Browsing all 205578 articles
Browse latest View live
↧

Is it possible to import and display a plotly graph saved as an html file...

I am new to programming, so forgive the question if it seems simple. I am attempting to import an interactive graph I plotted using the plotly graphing library and display it in the Jupyter notebook....

View Article


Getting observations until and including first different value (groups with...

I have a slightly convoluted way to slice a data frame by group from the first row (it always starts with the same value) till (and including) the first different value. I though about using...

View Article


Image may be NSFW.
Clik here to view.

Ggplot with a separate geom_vline for each group

I have around 160 countries (output$ccname), log GDP (output$lnrgdpch), output$endyear as year variable and a binary variable for when a leader died (1= died) output$natural2. I am trying to create...

View Article

Set same y-lim for multi panel plot using plot_model()

I have created a multi-panel plot using plot_model(). However, the scale limits on the y_axis came different for each panel. I first run a model fm then plot the predicted values:p <- plot_model(...

View Article

Why isn't my random walk simulation working correctly?

I have written the following code to simulate an unbiased random walk on Z^2. With probability 1/4, the "destination" is supposed to move one unit up, left, right, or down. So I made "destination" a...

View Article


what does the R shorcut `[[` mean?

I'm adapting the sapply function from someone else's script to pull in multiple spreadsheets and apply the site number to each item in the list (e.g. 124001B_calibrated.csv should become 124001B). My...

View Article

what if data to big for 1 reducer (RHadoop)?

i'm new to big data and hadoop thing. I try to find median with mapreduce. From what i know, mapper pass data to 1 reducer then 1 reducer sort and find the middle value using median() function. R...

View Article

skipping NULL output in apply

When using apply in R, is there some way to have it skip over vector elements that are NULL, such that when f(x2,y2) is undefined apply(x,1,f,y) returns c(f(x1,y1),f(x1,y2),f(x2,y2)) rather...

View Article


summary.manova error exact singularity in 'qr.coef'

R code: summary(manova(y~x),test="Wilks", tol=0) Error: Error in qr.coef(rss.qr, D %% ss[[i]] %% D) : exact singularity in 'qr.coef'For MANOVA, we need to calculate the inverse of (E+H) matrix. But in...

View Article


Choropleth Map in R with TIGER polygon data - blank spaces

I am trying to create a choropleth map in R using zipcode polygon data from TIGER database (using a response posted previously). The issue I am running into are large areas of the map that are blank. I...

View Article

Using for loop to creat multiple ggplots

p[[2]]<-ggplot(data = icadata, aes(x = icadata[[2]])) + geom_histogram() p[[3]]<-ggplot(data = icadata, aes(x = icadata[[3]])) + geom_histogram() p[[4]]<-ggplot(data = icadata, aes(x =...

View Article

Generate a list of tibble from a tibble by using map and select

I want to generate list of tibble fron one tibble in the following codes.tbl = tibble(id=1:10, a = rnorm(10), b = rnorm(10)) tbl_list = c("a", "b") %>% map(~ tbl %>% select(c("id", .))) The...

View Article

R- delete the tail word

Can someone teach me how to delete tail word ,thanks.from 1 North Africa 2 Algeria 3 Canary Islands (Spain)[153] 4 Ceuta (Spain)[154] to 1 North Africa 2 Algeria 3 Canary Islands 4 Ceuta I'm sad with...

View Article


Change pageType in DT pagination in R-Shiny module

Currently, I am designing an R-Shiny module that produces a DT table that includes paging. By default, DT default paging type is "simple_numbers". My goal is to change the default paging type to...

View Article

how to sum based on three different condition in R

mydata is as follow:gcode code year P Q 1 101 2000 1 3 1 101 2001 2 4 1 102 2000 1 1 1 102 2001 4 5 1 102 2002 2 6 1 102 2003 6 5 1 103 1999 6 1 1 103 2000 4 2 1 103 2001 2 1 2 104 2000 1 3 2 104 2001...

View Article


DT datatable transparent in Rmarkdown html reports

I need a watermark on my html output Rmarkdown but it is masked by the datatables.There might be a simple answer but i don't know Javascript yet. Any tip?I have tried using formatStyle but it doesn't...

View Article

Chrome adds unwanted margins to xaringan rmarkdown output

I am trying to print a PDF of a xaringan markdown that I have created. When I open up the html created by the R markdown, it renders perfectly fine in my browser. However, when I go to print it as a...

View Article


Image may be NSFW.
Clik here to view.

Reversed Stacked bar chart in R leads to weird positioning

I am trying to create a stacked bar plot in R, and to reverse the order.df <- structure(list(HouseholdEarnings = structure(c(2L, 2L, 3L, 3L, 3L, 2L, 2L, 1L, 4L, 2L, 3L, 6L, 5L, 4L, 2L, 1L, 2L, 3L,...

View Article

Image may be NSFW.
Clik here to view.

How do I plot error bars from a second dataframe of summary stats onto my...

I've got my plot how I like it as far as the raw data is concerned. Basically I want something like a bar chart but instead of a filled in bar you can see the raw data points and their confidence...

View Article

Remove first columns of every tibble in list in R

I have a list with several tibbles comprising several columns; and I want to remove the first 2 columns in each tibble (not using for loop). #Example data with tibble and list w <- c(1, 2, 3, 4, 5)...

View Article
Browsing all 205578 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>