Can't activte StringsAsFactors

I imported the data of iris dataset by clicking the file on the right hand side. Copy the codes and paste it at the R script. Then I copy and paste “stringsAsFactors = T” and place it at the command. I highlighted all lines and click run.
As you can see from the screenshot, no go in running the commands. Also, I noticed that if I type stringsAsFactors, R did not pop any options for my choosing….

Right now, the default read.csv() file will read the text columns in the CSV file as string. I need to fix it so I can do logistic regression analysis properly.

Help...

The read_csv function does not have a stringsAsFactor parameter. You can use the read.csv function from base R or you can use the col_types parameter in read_csv to set the desired columns to factors. See the help of read_csv for information about how to do that.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.