Most voted "factors" questions
5 questions
Sort by count of
-
13
votes2
answers10996
viewsError while converting numbers. How to convert factors to numbers?
In the following example: dados <- data.frame(x=c("11", "10", "20", "15"), y=c("25", "30", "35", "40")) dados x y 1 11 25 2 10 30 3 20 35 4 15 40 When trying to transform the variable x number,…
-
6
votes2
answers443
viewsReorder categories in a data frame
When we import data into R it sorts the categories alphabetically. How to change this order? Suppose these are the following data: df <- data.frame(categorias=c("Muito…
-
5
votes1
answer497
viewsHow to remove unused categories (levels) in the database
Suppose I have the following database: df <- data.frame(categorias=c("A","B","C","D","E"), valores=seq(1:5)) When I do a subset of that data frame the categories I removed continue. subdf <-…
-
1
votes1
answer49
viewsExtract attributes from a dataframe using the points of a second dataframe
Greetings. I’m trying to extract information from biomes from a dataframe (biomes_df), which has columns of temperature and precipitation. I want to use these values to extract which biomes the…
-
1
votes1
answer42
viewsIs it possible to multiply a variable of type "factor"?
I’m working with the following database: Qualis. I import this database using the rio::import() and write to the object "df". And I load library(dplyr) Upshot: library(dplyr)…