Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [r]

R is a free, open-source programming language & software environment for statistical computing, bioinformatics, visualization & general computing. Please use minimal reproducible examples others can run using copy & paste. Show desired output entirely. Use dput() for data & specify all non-base packages with library(). Don't embed pictures for data or code, use indented code blocks instead. For statistics questions, use https://stats.stackexchange.com.

r
0 votes
0 answers
9 views

Displaying Bar Graph in Shiny Dashboard Based on Select Input

I’m working on an interactive Shiny dashboard in R and I’m encountering an issue with my bar graph when no specific input is selected. Here’s what I’m trying to achieve: I have a bar graph that ...
Nandita Vaidyanathan's user avatar
1 vote
2 answers
18 views

Plot datetime data as just month not month-year

I have a data frame that looks like this: structure(list(date = structure(c(1592611200, 1624665600, 1626480000, 1620086400, 1624147200, 1624752000, 1626566400, 1.566e+09, 1621036800, 1651536000), ...
Ryan Gary's user avatar
  • 153
0 votes
0 answers
16 views

Regression with a 0-1 variable. Should be the same as running a t-test, but I get a different p-value [migrated]

I have a dataset in R where I have volatility estimates (in my case, just standard deviation of minute returns on that day) for different days: Date, Volatility, DayType The variable DayType is 0 or ...
Avocado's user avatar
  • 86
0 votes
0 answers
14 views

R: stat_density2d change color of density surface?

I'm using this example to create a heatmap in R: https://www.sharpsightlabs.com/blog/how-to-create-a-crime-heatmap-in-r/ ggmap(map_sf) + stat_density2d(data = sf_crime, aes(x = lon, y = lat, fill = ....
DiamondJoe12's user avatar
  • 1,685
0 votes
0 answers
17 views

How do I get rid of the weird long floating point error numbers that are shown when I convert a vector to a name of a vector [duplicate]

This function shows the floating point error when displaying the vector as names of another vector but not when it is displayed "normally" test <- rep(NA, times = length(seq(from = -0.5, ...
freyaisincompetent's user avatar
0 votes
2 answers
28 views

Find average temperature from a range of datetime for each day in dataframe

This is a subset of the dataframe I have: structure(list(name = c("waldorf", "waldorf", "waldorf", "waldorf", "waldorf", "waldorf", "...
Ryan Gary's user avatar
  • 153
-1 votes
1 answer
18 views

Possible issues with text encoding

I'm having a strange problem when I read a .csv file using read_csv. I'm afraid I don't think I can produce a reproducible example because the issue may involve my current R/RStudio session and how ...
whdaffer's user avatar
0 votes
0 answers
13 views

Google Cloud Platform Maps API key: Best practice to use in R to avoid incurring large API costs?

I'm using google maps API and ggmap to create a simple map of NYC in an RMarkdown document, in R: install.packages("ggmap") ggmap::register_google(key = "<your-api-key>", ...
DiamondJoe12's user avatar
  • 1,685
0 votes
0 answers
15 views

Why does my mutate(across()) function not work in lapply? [duplicate]

I have a simple function that works just fine on one data frame but doesn't do anything when I use it in lapply. For example: df1 <- data.frame(x = c(1:5), y = c(11:14, NA)) df2 <- data.frame(...
Sara's user avatar
  • 47
-4 votes
0 answers
25 views

Dplyr ( count for total number/treatment) [closed]

I have data frame with two columns the first column is the number of children under the age of five that receive a treatment and the second column classifies the type of the treatment. I would like to ...
Hamad Alonazi's user avatar
0 votes
0 answers
27 views

How to extract from multiple zip files only the csv files whose name starts with a specific string of characters in r? [duplicate]

Let's consider a folder myfile containing more than a hundred zip files (z001.zip, z002.zip, z003.zip ...) each always including 4 distinct csv files whose names always start with these three letters ...
denis's user avatar
  • 487
0 votes
0 answers
15 views

Increasing fontsize of numbers in forestplot in R

I am trying to prepare a forest plot for summarizing patient survival outcomes in multiple cohorts using the forestplot package in R. The plot comes out fine but I am struggling to increase the size ...
accibio's user avatar
  • 535
0 votes
0 answers
18 views

Problems running accuracy metrics on Validation_Set using fable package

I am unable to let the ACCURACY function point only to the Validation_set. The code perfectly works only in case the first argument of Accuracy is the whole dataset("data_tsibble") but in ...
Mark_'s user avatar
  • 21
-1 votes
1 answer
33 views

Produce table with data bars in base R or ggplot2

I am looking to make a table with horizontal bar graphs in each cell to display continuous numeric data with 2 categorical independent variables. It would look similar to the below (fictional data): ...
whv20's user avatar
  • 151
-1 votes
0 answers
22 views

Getting "invalid 'type' (character) of argument" error with numeric values when I do apply.weekly(data$x, sum) [closed]

I have a time series object and I am creating a list of the variables at different timesteps. when I do apply.weekly( , mean) it works fine, but when I want to sum the values over a week it gives me.. ...
Tatiana's user avatar

15 30 50 per page
1
2 3 4 5
33888