Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data.frame and ⁠stringsAsFactors #1151

Closed
lorenzwalthert opened this issue May 12, 2022 · 1 comment · Fixed by #1512
Closed

data.frame and ⁠stringsAsFactors #1151

lorenzwalthert opened this issue May 12, 2022 · 1 comment · Fixed by #1512

Comments

@lorenzwalthert
Copy link
Contributor

lorenzwalthert commented May 12, 2022

From the README:

tibble() does much less than data.frame(): it never changes the type of the inputs (e.g. it never converts strings to factors!)

This sounds outdated as of R 4.0.0 and might be confusing to users who are not familiar with the old behavior. Albeit one of the biggest confusions around data.frame is no longer true (fortunately), there are many more that could inherit its position in the README.

@lorenzwalthert lorenzwalthert changed the title data.frame and strings as factors data.frame and ⁠stringsAsFactors May 12, 2022
@IndrajeetPatil
Copy link
Contributor

This is repeated in a few places, and so Lorenz's comment also applies here:

The tibble print method draws inspiration from [data.table](https://rdatatable.gitlab.io/data.table), and [frame](https://github.com/patperry/r-frame). Like `data.table::data.table()`, `tibble()` doesn't coerce strings to factors by default, doesn't change column names, and doesn't use rownames.

They keep the features that have stood the test of time, and drop the features that used to be convenient but are now frustrating (i.e.
converting character vectors to factors).

@krlmlr krlmlr closed this as completed in 72942ac Feb 23, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants