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

Generate sequense from a value using R

I have a dataset that looks like this:date |country | crisis | 2011 q2 | AT | 0 | 2011 q3 | AT | 0 | 2011 q4 | AT | 1 | 2012 q1 | AT | 0 | 2012 q2 | AT | 1 | 2011 q1 | BE | 0 | 2011 q3 | BE | 0 | 2011...

View Article


plm panel regression error with duplicate id/time observations

I need to run a regression on a panel data. My data looks at prices of hotel room plans for two distinct observation points (a high season date and low season date).I have this data, and I run:...

View Article


Package ("qdap") fails to load with multiple errors

While installing qdap I have not faced any errors. But when loading the library, I face the follwing errors.> library(qdap) Loading required package: qdapDictionaries Loading required package:...

View Article

Generate all possible subsets of a given set and do some calculations

I have a data frame that looks like thissubj trial factor rt 1 1 Early 324 1 2 Early 405 1 3 Early 293 1 4 Early 738 1 5 Late 310 1 6 Late 389 1 7 Late 350 1 8 Late 782 1 9 Late 513 1 10 Late 401 2 1...

View Article

`data` must be a data frame, or other object coercible by `fortify()`, not a...

I'm trying to make a Dashboard in R Shiny. But I keep getting an error and can't figure out how to solve this. Error:data must be a data frame, or other object coercible by fortify(), not a logical...

View Article


create variable names with specific order in r

I want to get some variable names with specific order, like thisI0.n, I0.man, I0.woman, I0.low65, I0.up65I1.n, I1.man, I1.woman, I1.low65, I1.up65... ... ...I99.n, I99.man, I99.woman, I99.low65,...

View Article

Regex with a variable and not followed by anything in R

Once again, I'm struggling with Regex! I need to find, in R with the grep function, an expression:which includes a dynamic variable (a value that changes in a loop)and not followed by any character (a...

View Article

Combine full month name (Eg. January, February etc) and Year (Eg. 2018,2019...

This is my first question on Stackoverflow. I have recently started to use R programming. I have a dataset where month and year are in two columns.Year Month 2019 January 2018 February 2019 April 2018...

View Article


How to avoid permission denied on shiny server for other users

My colleagues have Setup a shiny Server on debian.If i create an app and run it, i can see it at : http://ourIP:8787/p/098a4074/. Goal:Now, i want to make it visible for my colleagues.Error:If my...

View Article


How to loop on a list R Error:[[i]] : invalid subscript type 'list'

>head(forecast1) $`104.csv` Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 104 2.980583 -1.173982 7.135147 -3.373276 9.334441 105 2.980583 -1.173982 7.135147 -3.373276 9.334441 106 2.980583 -1.173982...

View Article

R: using a for loop to create a new data table containing min and max...

I am currently working with a data set in R that contains four variables for a large set of individuals: pid, month, window, and agedays. I'm trying to create a loop that will output the min and max...

View Article

R-caret - retrieve coefficients

I am using R (package caret) to create a predictive model. I am rather satisfied now with my model (training and predict ok) and would like to get the coefficients of the different parameters (or the...

View Article

Split big column of rbinded columns to make wide data in R

I have a data frame which has a column of city names. Country names are specified for the cities. However, this is done in a way where one cell has a country name in it and then the following cells...

View Article


How to count co-occurrences/combinations once by ID/row and transform them...

Original (see Update below)Assume I have a data set with a low two digit number of columns (some NA/empty) and more than 100.000 rows, represented by the following example dataframedf <-...

View Article

Image may be NSFW.
Clik here to view.

caret rpart decision tree plotting result

I am training a decision tree model based on the heart disease data from Kaggle.Since I am also building other models using 10-fold CV, I am trying to use caret package with rpart method to build the...

View Article


How to perform bagging of decision trees and get the accuracy using...

I am trying to perform bagging of decision trees using a number of bag sizes 200, 400, 600 to get the accuracy of each bag size using oob estimation. How would I update my code to use multiple bag...

View Article

How to solve DiagrammeR waste of space issue in rmarkdown?

In RMarkdown, when I insert a flowchart created with package DiagrammeR it turns out that there is a lot of empty space around the chart (above and below). How can I get rid of that empty space,...

View Article


(Speed Challenge) Any faster method to calculate distance matrix between rows...

First of all, this is NOT the problem of calculating Euclidean distance between two matrices.Assuming I have two matrices x and y, e.g.,set.seed(1) x <- matrix(rnorm(15), ncol=5) y <-...

View Article

Using two data frames for a PCR in R

I am a biologist and I did research on biodiversity on several locations. Moreover, I measured environmental variables in those plots. Normally, I would analyse this data in Canoco5, however, I am...

View Article

Correlation between groups and ranks over different samples with R

I'm studying some scores on DNA for which each position has a score. I would like to find a method to know whether some samples are more often likely to have a high score, not in general, but position...

View Article
Browsing all 206180 articles
Browse latest View live


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