Open khangquangtran opened 1 year ago
The first two code lines in Lesson 27:
plot(mlb$Age,mlb$Weight,col=mlb$PosCategory)
and
with(mlb,plot(Age,Weight,col=PosCategory,cex=0.6))
are not compatible with current version of R (4.2.1).
The error when using these two lines:
Error in plot.xy(xy, type, ...) : invalid color name 'Catcher'
Suggested fixes based on Stack Overflow (link: https://stackoverflow.com/questions/66854539/r-does-not-assign-colors-to-plot-function):
plot(mlb$Age,mlb$Weight,col=as.factor(mlb$PosCategory))
with(mlb,plot(Age,Weight,col=as.factor(PosCategory),cex=0.6))
However, I am not sure if these suggested fixes are compatible with earlier versions of R.
Thanks. Was not a version issue. Anyway, I rewrote Lessons 29 and 30 completely. Thanks again.
The first two code lines in Lesson 27:
and
are not compatible with current version of R (4.2.1).
The error when using these two lines:
Suggested fixes based on Stack Overflow (link: https://stackoverflow.com/questions/66854539/r-does-not-assign-colors-to-plot-function):
and
However, I am not sure if these suggested fixes are compatible with earlier versions of R.