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

Removing factors #119

Closed
sstevens2 opened this issue Jun 12, 2022 · 3 comments
Closed

Removing factors #119

sstevens2 opened this issue Jun 12, 2022 · 3 comments

Comments

@sstevens2
Copy link
Contributor

This might be covered by #78 but thought I would explicitly suggest it. Need to update since in R4.0.0+ read.csv has stringsAsFactors=FALSE by default.

I suggest removing the factors section in the Data Structures episode and removing the factors section in the Exploring Data Frames episode. I think both of those sections should lift right out.

If factors are needed for the Raster and Vector lesson, then I would suggest still removing them from Exploring Data Frames but keeping them in Data Structures

@mikemahoney218
Copy link
Member

Hey @datacarpentry/curriculum-advisors-geospatial , here's an item I think we should talk about for our next meeting. This would be a pretty sizable change, but it's been ~3 years since R4.0 deprecated stringsAsFactors, and the option is going to be removed entirely in R 4.3 (https://cran.r-project.org/doc/manuals/r-devel/NEWS.html).

@albhasan
Copy link
Contributor

Good morning.

I would like to provide some context to this issue. I only found 6 references to 'stringsAsFactors' in this leson.

The first two are in the script ./renv/activate.R lines 299 and 561. I'm not an user of the renv package, but I think we can safely remove those as they are set to FALSE (R's default since v4). Besides, the readers aren't supposed to read this script.

The next one is in ./episodes/03-data-structures-part1.Rmd line 412 and it's part of the solution to challenge 3. It makes no difference because it's also set to FALSE. However, that challenge description makes sense from the perspective of R v3. I guess we could update or remove challenge 3.

The next 3 appear in ./episodes/04-data-structures-part2.Rmd lines 73, 348, and 369.

In line 73, stringAsFactors is set to TRUE and it includes a comment explainign the readers the default value of this property changed from R v3 to R v4. Besides, this line sets up data which is needed by a different task below. This was made so to ensure the code runs on R v4 while minimizing the changes to this lesson's contents. This is the change that would require more attention.

In lines 348 and 369 stringsAsFactors is set to FALSE and they can be safely removed.

Bests,

@mikemahoney218
Copy link
Member

Sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants