Objective: to practice PCA analysis with prcomp function
data set: R comes with iris data set
error reporting content: when removing the “species” column in Iris data set with data frame index, errors are always reported, as follows:
> iris_data <- [,-5]
Error: Unexpected'[' in "iris_data <- ["
Oh, it’s really a very low-level error. The reason for the error is that the data set is not indicated. After modification, the code is as follows:
iris_data <- iris[,-5]
the second similar problem:
original code:
fviz_pca_ind(iris.pca,
geom.ind = ("point", "text"), # show points only (nbut not "text")
col.ind = iris$Species, # color by groups
palette = c("#00AFBB", "#E7B800", "#FC4E07"),
addEllipses = TRUE, # Concentration ellipses
legend.title = "Groups"
)
report errors:
Error: Unexpected',' in:
"fviz_pca_ind(iris.pca,
geom.ind = ("point","
Modified code: added “C” in front
fviz_pca_ind(iris.pca,
geom.ind = c("point", "text"), # show points only (nbut not "text")
col.ind = iris$Species, # color by groups
palette = c("#00AFBB", "#E7B800", "#FC4E07"),
addEllipses = TRUE, # Concentration ellipses
legend.title = "Groups"
)
Read More:
- Template cannot be rendered due to the joint query of populate in mongoose: syntax error: unexpected token r in JSON at position 0
- [Solved] No tf data. Actual error: Fixed Frame [world] does not exist
- Refresh 404 after packaging Vue project, uncaught syntax error: unexpected token <
- vue VM682:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0
- How to Solve Error: “syntax error near unexpected token `newline’”
- Webpack Pack and compress ES6 files with errors: ERROR in js/xxxxxx.js from UglifyJs Unexpected token punc ()
- MindSpore Error: [ERROR] MD:unexpected error.Not a valid index
- Parsing error in eslint parsing: unexpected token [How to Solve]
- [Solved] eslint Error: error Parsing error: Unexpected token <
- [Solved] R Language Error: Error in RStudioGD() : Shadow graphics device error: r error 4 (R code execution error)
- [Solved] SyntaxError:JSON.parse:unexpected character at line 1 column 1 of the JSON data
- tf.nn.dilation2d Call Error: TypeError: dilation2d_v1() got an unexpected keyword argument ‘data_format’
- [Solved] Kafka Start Log Error: WARN Found a corrupted index file due to requirement failed: Corrupt index found
- [Solved] URIError: Failed to decode param ‘/%3C%=%20BASE_URL%20%3Estatic/index.%3C%=%20VUE_APP_INDEX_CSS_HASH%20%3E.css’
- [Solved] R Language Error: Discrete value supplied to continuous scale
- Adjusted frame length exceeds 4096: 5637-discarded server solution
- How to Solve Android Arouter Frame Autowired Error
- [Solved] yii Frame Error: Warning!symlink() has been disabled for security reasons
- [Solved] Failed to load response data: no data found for resource with given identifier
- [Solved] Mac Install mongodb error: NonExistentPath: Data directory /data/db not found.