Comments (3)
If you don't know the set of levels in advance, why are you using a factor and not a character vector?
from forcats.
Because I have an ordering of categories, and I'd just like the new levels to appear at the end. This happens often when creating a variant of a variable with a more detailed classification.
Also, in the specific case of if_else
, copying the levels from the true
operand is kind of an arbitrary choice.
from forcats.
I think that's a reasonable thing to want, but for now, it's outside the scope of forcats.
from forcats.
Related Issues (20)
- Release forcats 1.0.0
- Update `fct_reorder2()`
- Make forcats 1.0.0 Tidyverse blog article more instructive HOT 1
- fct_recode removes `label` attribute HOT 4
- fct_na_value_to_level() adds a level for NA value even if it is not need HOT 1
- `fct_reorder2()` drops values HOT 1
- Assigning a level to NULL in fct_collapse does not remove it.... HOT 1
- "fct_na_value_to_level" not worked well in gtsummary HOT 1
- fct_relevel not working HOT 2
- Errors in `fct_reorder2` documentation
- Feature request: rename `fct_na_value_to_level` etc to `fct_na_to_level` etc as more readable HOT 1
- Document `fct_lump()` in own file
- Upkeep for forcats (2022)
- Feature Request: fct_trim()
- ```fct_reorder``` treatment of missing values in .x depends on whether .f is a factor or a character vector
- `fct_cross()` orders levels by second factor before the first factor
- Could fct_reorder be easier to use for where `.desc = TRUE`?
- Feature Request: Add handling of ordered factors to fct()
- Feature Request: Allow Increasing Order in `fct_infreq`
- Typo in Introduction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forcats.