Top "R-faq" questions

The r-faq tag is created to group a limited number of questions discussing problems that come up regularly on the R tag.

Why are these numbers not equal?

The following code is obviously wrong. What's the problem? i <- 0.1 i <- i + 0.05 i ## [1] 0.15 if(i==0.15) cat("…

r floating-point floating-accuracy r-faq
What do the %op% operators in mean? For example "%in%"?

I tried to do this simple search but couldn't find anything on the percent (%) symbol in R. What does %in% …

r syntax operators r-faq
Set default CRAN mirror permanent in R

How can I set a specific CRAN mirror permanently in R? I want to set it permanently in my laptop …

r cran r-faq
Dealing with TRUE, FALSE, NA and NaN

Here is a vector a <- c(TRUE, FALSE, FALSE, NA, FALSE, TRUE, NA, FALSE, TRUE) I'd like a …

r boolean logical-operators na r-faq
General suggestions for debugging in R

I get an error when using an R function that I wrote: Warning messages: 1: glm.fit: algorithm did not converge 2: …

r debugging r-faq
What does "S3 methods" mean in R?

Since I am fairly new to R, I do not know what the S3 methods and objects are. I found …

r oop r-faq r-s3 r-s4
R round to nearest .5 or .1

I have a data set of stock prices that have already been rounded to 2 decimal places (1234.56). I am now trying …

r rounding r-faq
How to call an object with the character variable of the same name

I'm trying to write a function in R to batch-analyse a number of files in a similar manner. The files …

r r-faq
Variable name restrictions in R

What are the restrictions as to what characters (and maybe other restrictions) can be used for a variable name in …

r r-faq
Pasting two vectors with combinations of all vectors' elements

I have two vectors: vars <- c("SR", "PL") vis <- c(1,2,3) Based on these vectors I would …

r r-faq