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

oj.R line 8 levels(oj$brand) returns NULL #18

Closed
pm145 opened this issue Dec 29, 2020 · 0 comments
Closed

oj.R line 8 levels(oj$brand) returns NULL #18

pm145 opened this issue Dec 29, 2020 · 0 comments

Comments

@pm145
Copy link

pm145 commented Dec 29, 2020

Original code
## read in the data oj <- read.csv("oj.csv") head(oj) levels(oj$brand)

levels(oj$brand) returns NULL.

Modified code

## read in the data oj <- read.csv("oj.csv", stringsAsFactors=T) head(oj) levels(oj$brand)

This works.

@pm145 pm145 closed this as completed Jan 14, 2021
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

1 participant