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

Add box with 10 R functions never to use #51

Open
mpjashby opened this issue Jul 16, 2022 · 4 comments
Open

Add box with 10 R functions never to use #51

mpjashby opened this issue Jul 16, 2022 · 4 comments
Labels
2024 enhancement New feature or request

Comments

@mpjashby
Copy link
Owner

For example, base::attach().

In each case, explain why students shouldn't use it.

This should probably go in the tutorial on handling errors, since the reason the functions should not be used will typically because they make code (or coders) more prone to errors.

@mpjashby mpjashby added enhancement New feature or request 2023 labels Jul 16, 2022
@mpjashby
Copy link
Owner Author

utils::read.csv(), since it's always better to use readr::read_csv() due to the result being easier to work with.

@mpjashby
Copy link
Owner Author

base::ifelse() because it sometimes silently changes the types of objects or strips attributes – use dplyr::if_else() instead.

@mpjashby
Copy link
Owner Author

There aren't enough of these yet to make a new section worthwhile, so I'll hold this over for next year.

@mpjashby mpjashby added 2024 and removed 2023 labels Jan 19, 2023
@mpjashby
Copy link
Owner Author

base::as.data.frame() because it's always better to use a tibble, and because some students use this function when data is already in a df/tbl format (I don't know why).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant