2016年09月01 - Possibly a dumb question, but I recently saw Matt Dowle write some code with as.factor(), specifically for (col in names_factors) set(dt, j=col, value=as.factor(dt[[col]])) in a comment to this answer
2014年07月21 - I'm wondering if there's any function to show the mapping of levels and values of a factor variable in R? For example I would expect an output like this:
2018年04月16 - I have list1 of dataframes, which i want to do.call("rbind", list1)later, but first i want to add a identifying factor to each of the dataframes. This factor should be the name of the dataframe:
2011年05月03 - There seems to be a difference between levels and labels of a factor in R. Up to now, I always thought that levels were the 'real' name of factor levels, and labels were the names used for output (suc
2011年08月17 - I have a dataframe like x where the column genes is a factor. I want to remove all the rows where column genes has nothing. So in table X I want to remove row 4. Is there a way to do this for a large
2014年11月28 - I have a vector with NA values that I would like to replace by a new factor level NA.
This works, but it seems like a strange way to do it.
This is the