Have a look at ?as.factor
. In your case
mydata$COR <- as.factor(mydata$COR)
More Related Contents:
- How to convert a data frame column to numeric type?
- Convert type of multiple columns of a dataframe at once
- Convert data.frame column to a vector?
- Convert Named Character Vector to data.frame
- Replace logical values (TRUE / FALSE) with numeric (1 / 0)
- Convert dataframe column to 1 or 0 for “true”/”false” values and assign to dataframe
- Convert hours:minutes:seconds to minutes
- Convert numeric to date
- How to resolve “invalid number of 'breaks'” [closed]
- Calculate gradient of data in R (or other) [closed]
- Dynamically select data frame columns using $ and a character value
- Controlling number of decimal digits in print output in R
- Offline install of R package and dependencies
- How to save plots that are made in a shiny app
- Confusion between factor levels and factor labels
- ggplot plots in scripts do not display in Rstudio
- What’s the best way to use R scripts on the command line (terminal)?
- General suggestions for debugging in R
- ignore NA in dplyr row sum
- Creating dummy variables in R data.table
- Can’t print to pdf ggplot charts [duplicate]
- How do I change the background color of a plot made with ggplot2
- What is the difference between gc() and rm()
- How to change the figure caption format in bookdown
- How to test if list element exists?
- How to split a data frame into multiple dataframes with each two columns as a new dataframe?
- Merging two columns into one in R [duplicate]
- Simple approach to assigning clusters for new data after k-means clustering
- How to save() with a particular variable name
- ggplot embedded fonts in pdf