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

R issue when moving an rmd file from one project to another (working...

I have two projects in R. I've moved an .Rmd document from project 1 to project 2. When I used the .Rmd file which I had moved to project 2 to try and read in some data I get the following error...

View Article


Image may be NSFW.
Clik here to view.

Use stat_summary to label median line on boxplot

I have a function wherein I'm trying to use stat_summary() to plot the value of the median just above the median line on a geom_boxplot(). I've reduced my problem and created a toy example to simplify...

View Article


find the string present and update the frequency

I have 2 dataframes, I am trying to find if the words from df dataframe is present in dataframe sentence's texts then I need to mutate source values as columns and print frequency for each source...

View Article

I'm having trouble with sending a form using POST to retrieve data in R

I'm having trouble collecting doctors from https://www.uchealth.org/providers/. I've found out it's a POST method but with httr I can't seem to create the form. Here's what I haveurl = url =...

View Article

add plotting symbol in CCA plot in R

I want to generate canonical correspondence analysis(CCA) plot, to show the influence of environmental parameters on species distribution using this code:spe <- read.csv("spe.csv", row.names=1,...

View Article


R Aggregate days and count specific observations for each day

Day Time Numbers 6388 2017-02-01 10:43 R33 7129 2017-02-04 15:32 N39.0, N39.0, N39.0 9689 2017-02-17 08:54 S72.11, S72.11, S72.11, S72.11 6703 2017-02-02 18:55 R11 9026 2017-02-13 17:34 S06.0, S06.0,...

View Article

subsetting yearmon objects

I have monthly data library(zoo); library(data.table) dat <- data.table(month=as.yearmon(paste0(“2019-0“,1:9), “%Y-%m“)) and I would like to subset it to months after, say, May 2019....

View Article

Why is matrix product slower when matrix has very small values?

I create two matrices A and B of the same dimension. A contains larger values than B. The matrix multiplication A %*% A is about 10 times faster than B %*% B. Why is this?## disable openMP...

View Article


Loop ARIMA combination to minimize RMSE

Goal : I want to create a loop in R that takes every combination of an ARIMA model on my insample data to get the smallest RMSE when I compare it with the out-of-sample data. What I haveThis is what I...

View Article


Unable to plot varibles from dataframe in R

plot_dist = function(df1,df2,features,nrows,ncols){ fig_list = list() j=1 for (feature in features){ print(feature) fig=ggplot()+ geom_density(data=df1,aes(feature),color="blue")+...

View Article

Continue block command

I try to run this code:library (stackr) df <- data.frame(id = c(1144035, 58936751)) for (j in 1:2) { tryCatch({ reputation_history <- stack_users(df$id[j], "reputation-history") }, error =...

View Article

r - Error: `data` and `reference` should be factors with the same levels

I've trained an artificial neural network algorithm with caret and nnet using r. I am trying to generate a meaningful output - using Confusion Matrix, ideally - but continue to get errors such as "data...

View Article

MS/Metabolomics R packages with VAST scaling

I am looking for MassSpec/Metabolomic R analysis packages that includes VAST scaling. I'd really appreciate any pointers.

View Article


Image may be NSFW.
Clik here to view.

Why do my ROC plots and AUC value look good, when my confusion matrix from...

I'm using the the package randomForest in R to create a model to classify cases into disease (1) or disease free (0):classify_BV_100t <- randomForest(bv.disease~., data=RF_input_BV_clean, ntree =...

View Article

Delete string pattern in R while keeping the rest of the string

I know this has been asked previously, but I'm unable to find an case that is comparable to the situation in my data. Here's a sample of my data:> head(dataraw) success 2 day pre during time...

View Article


Image may be NSFW.
Clik here to view.

How to plot geom_line over bar chart grouped by x variable not fill variable?

I have a data frame df Group Time_Period mean uci lci 1 A Before 4.712195 5.054539 4.369852 2 A After 5.881463 6.241784 5.521142 3 B Before 5.349754 5.872940 4.826567 4 B After 6.653595 7.246231...

View Article

How to make a proportion from a dataset

Basically, my dataset is about the total mysteries that occurred from 2000-2015. There is a column that is literally titled Mystery.Solved and in that column, each one is either "Yes" for yes it has...

View Article


Finding the longest consecutive streak in a tibble column

I have the following tibble:my_tbl <- tribble( ~year, ~event_id, ~winner_id, 2011, "A", 4322, 2011, "A", 9604, 2012, "A", 4322, 2012, "A", 9604, 2012, "A", 1663, 2013, "A", 4322, 2014, "A", 5478,...

View Article

Is it possible to remove horizontal borders from xtable?

I have a bit of code from a shinyapp that determines what will be exported to a pdf document: special_ortho_table <- reactive({ if(input$ortho == "yes"){ sp_ortho_table <- drugsUI %>%...

View Article

R: Rolling mean on values above variable quantile threshold

I have a large data.table. I require:the rolling quantile of a numeric columnthe rolling mean of the numeric column applied on values above the (moving) quantile thresholdlibrary(data.table)...

View Article
Browsing all 204742 articles
Browse latest View live


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