About 2,050,000 results
Open links in new tab
  1. r - Why use as.factor() instead of just factor() - Stack Overflow

    ‘factor(x, exclude = NULL)’ applied to a factor without ‘NA’s is a no-operation unless there are unused levels: in that case, a factor with the reduced level set is returned. ‘as.factor’ coerces …

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

    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 this in a data processing step outside the lm() call though. My answer below …

  3. r - How to convert a factor to integer\numeric without loss of ...

    But annoyingly, there is nothing to handle the factor -> numeric conversion. As an extension of Joshua Ulrich's answer, I would suggest to overcome this omission with the definition of your …

  4. r - Changing factor levels with dplyr mutate - Stack Overflow

    Jan 28, 2015 · From my understanding, the currently accepted answer only changes the order of the factor levels, not the actual labels (i.e., how the levels of the factor are called). To illustrate …

  5. 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, …

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

    I would like to change the format (class) of some columns of my data.frame object (mydf) from charactor to factor. I don't want to do this when I'm reading the text file by read.table() function. ...

  7. Filter factor levels in R using dplyr - Stack Overflow

    May 5, 2015 · You can easily convert a factor into an integer and then use conditions on it. Just replace your filter statement with: filter(as.integer(Epsilon)>2) More generally, if you have a …

  8. How to change the number of replicas of a Kafka topic?

    Jun 22, 2016 · Option "[replication-factor]" can't be used with option"[alter]" It is funny that you can change number of partitions on the fly (which is often hugely destructive action when done in …

  9. Subset a dataframe by multiple factor levels - Stack Overflow

    How can I avoid using a loop to subset a dataframe based on multiple factor levels? In the following example my desired output is a dataframe. The dataframe should contain the rows of …

  10. 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 …

Refresh