Top "R-factor" questions

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

Drop unused factor levels in a subsetted data frame

I have a data frame containing a factor. When I create a subset of this dataframe using subset or another …

r dataframe r-factor r-faq
Colouring plot by factor in R

I am making a scatter plot of two variables and would like to colour the points by a factor variable. …

r colors plot r-factor
How do I convert certain columns of a data frame to become factors?

Possible Duplicate: identifying or coding unique factors using R I'm having some trouble with R. I have a data set …

r numeric r-factor
Plotting with ggplot2: "Error: Discrete value supplied to continuous scale" on categorical y-axis

The plotting code below gives Error: Discrete value supplied to continuous scale What's wrong with this code? It works fine …

r ggplot2 scale categorical-data r-factor
Imported a csv-dataset to R but the values becomes factors

I am very new to R and I am having trouble accessing a dataset I've imported. I'm using RStudio and …

r r-factor read.csv
R error "sum not meaningful for factors"

I have a file called rRna_RDP_taxonomy_phylum with the following data : 364 "Firmicutes" 39.31 244 "Proteobacteria" 26.35 218 "Actinobacteria" 23.54 65 "Bacteroidetes" 7.02 22 "Fusobacteria" 2.38 6 "Thermotogae" 0.65 3 unclassified_…

r r-factor categorical-data
Converting a factor to numeric without losing information R (as.numeric() doesn't seem to work)

Possible Duplicate: R - How to convert a factor to an integer\numeric in R without a loss of information …

r r-factor
Coerce multiple columns to factors at once

I have a sample data frame like below: data <- data.frame(matrix(sample(1:40), 4, 10, dimnames = list(1:4, LETTERS[1:10]))) I want …

r dataframe r-factor
Unseen factor levels when appending new records with unseen string values to a dataframe, cause Warning and result in NA

I have a dataframe (14.5K rows by 15 columns) containing billing data from 2001 to 2007. I append new 2008 data to it with: …

r dataframe append r-factor
Confusion between factor levels and factor labels

There seems to be a difference between levels and labels of a factor in R. Up to now, I always …

r r-factor r-faq