Enter the following syntax:
read.table(site_file,header=T)-> data
data< -data[which(data[,5]==”ADD”),]
A:
Error in `[.data.frame`(data, , 5) : undefined columns selected
Calls: plot_manhatton -> [ -> [.data.frame -> which -> [ -> [.data.frame
After a few attempts, change the command to:
read.csv(site_file,header=T)-> data
data< -data[which(data[,5]==”ADD”),]
It’s ready to run.
The reason for undefined Columns selected error is that What I imported was a CSV file, but I used read.table when Reading the file. After changing to read.csv, there is no problem.
Reproduced in: https://www.cnblogs.com/chenwenyan/p/5384714.html
Read More:
- Pandas read the CSV file error filenotf oundError:File b ‘***.csv’ does not exist
- Datatable plug-in error: uncaught typeerror: cannot read property ‘style’ of undefined
- JS prompt cannot read property ‘style’ of undefined
- TypeError: Cannot read property ‘username‘ of undefined
- Vue: cannot read property ‘substring’ of undefined“
- Cannot read property ‘properties’ of undefined
- [Vue warn]: Error in render: “TypeError: Cannot read properties of undefined
- TypeError: Cannot read property thisCompilation of undefined
- [Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
- Vue error resolution: typeerror: cannot read property ‘_ t’ of undefined”
- Vue error resolution: TypeError: Cannot read property’_t’ of undefined”
- Uncaught type error: cannot read property ‘MSIE’ of undefined
- [_ Note] Vue.js reported an error: Cannot read property’validate’ of undefined”
- Vue uses this. $refs. Subcomponent Ref. method to report an error: cannot read property ‘resetfields’ of undefined problem
- Vue error in render: “typeerror: cannot read property ‘name’ of undefined”
- Cannot read property ‘substring’ of undefined in Vue
- Error reported by wechat applet: cannot read property ‘forceupdate’ of undefined
- Cannot read property ‘catch‘ of undefined“
- Error in mounted hook: “TypeError: Cannot read property ‘init‘ of undefined“
- Error in created hook: “typeerror: cannot read property ‘cm’ of undefined”