Skip to content
Snippets Groups Projects

update scripts to future proof against R 4.0.0+ updates

  • https://stat.ethz.ch/pipermail/r-announce/2020/000653.html

    R now uses a stringsAsFactors = FALSE default, and hence by default no longer converts strings to factors in calls to data.frame() and read.table().

  • this breaks all instances of levels() being used on data.frames read using read.csv()

  • switching to unique() solves this

  • unique() used on factors (R < 4.0.0, currently on the cluster) still returns the same values as levels(), but as a factor, which does not cause problems (but is a little ugly in interactive use)

Merge request reports

Merged by avatar (Mar 14, 2025 12:26am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading