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

"'X' and 'Y' lenghts differ" Error in RStudio

I have a dataset of 503 numbers ranging from -0.8 to 2.7 down one Excel column. I'm looking to sample the normal distribution by using dnorm through the following:plot(x=seq(from=-1,to=3,by=0.01),...

View Article


Bar Chart in R - I can do this in Python and Tableau but having trouble in R

Trying to build a simple bar chart in R. This is the link to the data (https://data.world/makeovermonday/2020w3-is-it-time-to-treat-sugar-like-smoking) I need to build a simple bar chart that shows...

View Article


R Shiny - Coding for regular API JSON update

I am attempting to code a Shiny application that hits a JSON API as its main data source. The app would hit the API once per minute to retrieve updated data in JSON format, then use jsonlite package to...

View Article

Need to separate strings into multiple variables based on numeric versus...

I have a data frame with one variable. It looks something like this:df <- data.frame(c("25 Edgemont 52 Sioux County", "57 Burke 88 Papillion-LaVista South")) To provide more context, each...

View Article

How to set a code to automatically add today's date to a filename?

Every day I have to change a date "YYMMDD" manually then run a code. I would like to find a way to make this change automatically. So I can just run the code without having to manually enter today's...

View Article


Add an indication arrow inside DT cell which will show trend for each time...

I created a shiny app which uses the dataframe below to summarize by Dealer showing previous day count of name and last 3 days count of name based on the fact that we are in the most recent date...

View Article

Excluding sheets in readxl

I have data that comes in Excel spreadsheets, with a varying number of sheets. Rather than reading all the sheets, as has been explained elsewhere, I would like to exclude the first sheet when...

View Article

Image may be NSFW.
Clik here to view.

How to show labels in geom_text that is proportional to geom_bar group variable

I have been trying to output in ggplot a graph that shows labels in percentage value and in proportion to the grouping factor defined in geom_bar. Instead of % values proportionate to the overall...

View Article


R Forecasting in Excel using the BERT console

Does anyone know how I can use the "forecast" function from R in Excel through the BERT console? I tried writing the following function:Forecast.sea <- function(x,h){ ts.data <- predict(x,h)...

View Article


Match and replace string using REGEX in Sqlite?

I have a table called personal_websessions that contains data in the following format: id_no | website_link 1 | google.com 2 | stackoverflow.com 3 | msn.com You can create this table using the...

View Article

How to make a data frame selecting shiny app in R?

I have a data frame with three columns:x = data.frame(group=c("group1", "group2", "group3","group1","group3", "group4", "group2"), user=c("user1", "user3", "user5", "user9", "user14", "user18",...

View Article

Add arrow indicator in the 1st row of a dataframe instead of the second

I have the shiny app below which compares the values of the 1st row with the values of the 2nd and then displays arrows in the 2nd row. How can I apply this in the 1st row instead of the 2nd? I used...

View Article

R: Combining dataset and lookup-table to extract value to new colume

I want to combine to dataframes, df1 with 15.000 obs and df2 consisting of 2.3 mill. I'm trying to match values, if df1$col1 == df2$c1, AND df1$col2 == df2$c2, then insert value from df2$dummy, to...

View Article


function importance for randomForest package

I wanted to use the Random Forest to find the most important features for a classification problem (I have two classes: 0 and 1). I created the model:rf = randomForest(y ~ ., data = df,...

View Article

Image may be NSFW.
Clik here to view.

Plotting different rows as different lines in R with matplot

I would like to plot different rows as different lines in the same plot to illustrate the movements of the average development of 3 groups: All, Men and Women. However, I'm not getting one of the lines...

View Article


Image may be NSFW.
Clik here to view.

Flow duration curve using facet_wrap of ggplot in R?

I am using fdc of hydroTSM package. I have three data.frame and i would like to construct Flow duration curves (FDC) of the data.frame using facet_wrap functionality of ggplot to have the plots in...

View Article

Error when trying to fit data to gamma distribution

Here is my code:data("airquality") head(airquality) Solar <- airquality$Solar.R library(fitdistrplus) fit.solar <- fitdist(Solar, distr = "gamma", method = "mle") Any thoughts? Thank you!

View Article


In R, can you write data from SentimentR to a csv file?

I'm currently using the following scriptlibrary(sentimentr) decpir <- read.csv("decpir.csv", header = TRUE, stringsAsFactors = FALSE) results <- sentiment(decpir$Text) I'd like to write the...

View Article

Replace substring if contained in larger string in R

I have a data frame with a column that contains SQL queries. I have a second data frame that has Old Variables to search for in the SQL query and two possible New Variables to replace with. If the Old...

View Article

R httr::GET - Browser out of date

I have a problem when I try to get a page using the package httr. I'm try to get this page with the follows command:r <- GET("https://www.reclameaqui.com.br/empresa/madeiramadeira/",...

View Article
Browsing all 208990 articles
Browse latest View live


Latest Images

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