Questions tagged [r-factor]

The factor is a data type in the R language, used to encode categorical or enumerated data.

The factor is a data type in the R language, used to encode categorical or enumerated data. This data type is often used in statistical models.

This type is encoded as an integer value, along with a lookup table of factor levels. The factor levels are represented as a vector of character strings. This representation allows easy conversion to character, and efficient use in statistical computations.

437 questions
-3
votes
2 answers

R summing factors

I split some data according to factors like: a <- factor(data$fact) b <- split(data,a) Now I would like to add some of the factor together e.g. tot <- b$A+b$B but I'm getting the following error, "sum" not meaningful for factors Any help would…
user1256539
-4
votes
1 answer

Specifying directly factor levels and sizes

How would you create a factor with levels and corresponding sizes directly specified? e.g. [0, 5) 6 [5, 7) 20 [7, 13) 4 Edit: This question is related to grouped frequency distributions. Sometimes (say in textbooks), you don't get access…
green diod
  • 1,211
  • 2
  • 10
  • 23
1 2 3
29
30