About 8,480,000 results
Open links in new tab
  1. r - How to convert a factor to integer\numeric without loss of ...

    See the Warning section of ?factor: In particular, as.numeric applied to a factor is meaningless, and may happen by implicit coercion. To transform a factor f to approximately its original …

  2. r - list all factor levels of a data.frame - Stack Overflow

    Dec 28, 2014 · with dplyr::glimpse(data) I get more values, but no infos about number/values of factor-levels. Is there an automatic way to get all level informations of all factor vars in a …

  3. Convert data.frame column format from character to factor

    Dec 6, 2018 · The complete conversion of every character variable to factor usually happens when reading in data, e.g., with stringsAsFactors = TRUE, but this is useful when say, you've …

  4. Convert all data frame character columns to factors

    Given a (pre-existing) data frame that has columns of various types, what is the simplest way to convert all its character columns to factors, without affecting any columns of other types? …

  5. How to force R to use a specified factor level as reference in a ...

    You should do the data processing step outside of the model formula/fitting. When creating the factor from b you can specify the ordering of the levels using factor(b, levels = c(3,1,2,4,5)). Do …

  6. r - summarizing counts of a factor with dplyr - Stack Overflow

    Sep 12, 2014 · I want to group a data frame by a column (owner) and output a new data frame that has counts of each type of a factor at each observation. The real data frame is fairly large, …

  7. Convert existing dataframe variable to factor in Tidyverse

    Feb 26, 2022 · When you have an existing character variable in a dataframe, is there an easy method for converting that variable to a factor using the tidyverse format? For example, the …

  8. when to use factor () when plotting with ggplot in R?

    Feb 25, 2013 · Is the general rule to use factor when the variable being used to determine the shape/size/colour is discrete, and not continuous? Or is there another use of factor in this …

  9. r - Re-ordering factor levels in data frame - Stack Overflow

    Aug 24, 2013 · Re-ordering factor levels in data frame [duplicate] Asked 12 years, 2 months ago Modified 4 years, 2 months ago Viewed 254k times

  10. When to use as.numeric and as.factor in R - Stack Overflow

    Feb 17, 2020 · Factors (with as.factor) are variables that have discrete values, which may or may not be ordered. In other areas of science outside R they're often called categorical values. For …