Questions tagged [r]

R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.

R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.

R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, ...) and graphical techniques, and is highly extensible. The S language is often the vehicle of choice for research in statistical methodology, and R provides an Open Source route to participation in that activity.

One of R's strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.

R was created by Ross Ihaka and Robert Gentleman and is now developed by the R Development Core Team. The R environment is easily extended through a packaging system on CRAN.

R is available as Free Software under the terms of the Free Software Foundation's GNU General Public License in source code form. It compiles and runs on a wide variety of UNIX platforms and similar systems (including FreeBSD and Linux), Windows and Mac OS.

1485 questions
6
votes
6 answers

How to count observations per ID in R?

I have a large amount of Data where I have to count meassurments per one ID. What I already did was creating a Data Frame over all Files and I omited the NAs. This part works properly. I was wondering if the nrow-function is the right function to…
Cassandra
  • 71
  • 1
  • 1
  • 3
5
votes
1 answer

How to subset rows from a data frame with comparison operators in R

I have a data frame (a csv file) with dimensions 100x6 and I need only the columns c("X1", "X2", "X4") and the rows in which the value of "X1" is greater than 30. So I did: data_frame <- read.csv ("data_frame") data_frame [c("X1", "X2",…
5
votes
1 answer

Package that is similar to R's caret?

Recently I stumbled upon a R package that works similar like caret, but I can't remember what it's name was and I can't find it. It seemed to be less well known, but at least as extensive. Someone able to help? Edit: I search for this other package…
Make42
  • 752
  • 2
  • 8
  • 18
5
votes
2 answers

Error with negative bins while melting dataframe

I have a dataframe 'd' like this: breaks counts.x counts.y 1 -20 1 1 2 -15 0 1 3 -10 0 5 4 -5 4 18 5 0 13 27 6 5 18 25 7 10 9 …
pinky
  • 151
  • 1
  • 9
4
votes
2 answers

R: comparison (6) is possible only for atomic and list types

I am getting the error in the subject line for the following piece of code in R. r<- matrix(c(2,4, 1,5,5,3, 4,5,1,2,3,4), nrow=3) for (u in 1:nrow(r)) for (x in 1:ncol(r)) r_hat<- function(u,x) { if (r_hat >r[u,x]) { …
UD1989
  • 258
  • 2
  • 3
  • 6
4
votes
1 answer

Vectorization of for loop in sentiment analysis

I'm struggling with for loop in R. I have a following data frame with sentences and two dictionaries with pos and neg…
4
votes
1 answer

Count and summarise ID's each day while creating a new column that shows the accumulated ID's

I have two column, first one being the ID of a customer and second one being the Date of purchase. ID Date 1 2017-01-17 2 2017-01-17 3 2017-01-17 4 2017-01-17 5 2017-01-17 1 2017-01-17 7 2017-01-17 1…
JelleManne
  • 41
  • 2
4
votes
3 answers

How to keep track of assumptions/design choices and avoid errors in complex projects

I am part of a small team data analysts that has been trying to optimise the process we use to keep track of the assumptions and design choices that are made over the lifetime of a complex data science project (several months) - ultimately we want…
user16791
  • 41
  • 1
3
votes
1 answer

How to calculate events per day in R including dates when no events occurred?

I would like to create a data frame in which in the first column I will have all the dates from a certain period of time and in the second the number of events that occurred on each date including dates when no events occurred. I would also like to…
3
votes
3 answers

Why does Caret featurePlot returns returns NULL?

I am trying to use featurePlot of caret in R. This is the code I am using: trellis.par.set(theme = col.whitebg(), warn = FALSE) caret::featurePlot(x = df[, 3:6], y = df$ud, plot = "scatter") where all the columns of…
Vitomir
  • 163
  • 1
  • 4
3
votes
1 answer

Is it my Sales growth is depend on Commisions/Discounts?

I prefer this model in R We are capturing sales data by time series (Month by month). Some of items have commissions and some have Discounts and others have both commissions and discounts. Is it Commissions or Discounts or commissions + Discounts…
Murali
  • 263
  • 1
  • 5
3
votes
1 answer

Is there an R build tool like Maven?

Is there an R build tool (like Maven or Gradle for Java) to get the dependencies and package an R project?
Javide
  • 177
  • 7
3
votes
2 answers

How to run R programs on multicore using doParallel package?

I am running SVM algorithm in R.It is taking long time to run the algorithm.I have system with 32GB RAM.How can I use that whole RAM memory to speed my process.
3
votes
1 answer

survey data analysis (discrete data)

I did small survey and get such data: |-------------| Yes | No | Dont_Know | |-------------| | | | | Employee | 60 | 5 | 5 | | Workers | 17 | 0 | 1 | | Businessmen | 71 | 5 | 10 | |…
AndriusZ
  • 145
  • 4
2
votes
3 answers

How to get common values between two multi sets?

I am working in R. I have two vectors; A and B of lengths 5913 and 3733 respectively (with entries are repeated). I want to extract those values (with repetitions) that are present in both A and B. I have done (A %in% B) (lets call it C) and (B…
user62198
  • 1,091
  • 4
  • 16
  • 32
1
2 3
10 11