I am totally new to R programming. When I start working on a dat.file without he
ID: 3151885 • Letter: I
Question
I am totally new to R programming. When I start working on a dat.file without headers, I got the result as follow.
> sleep<-read.table("D:\ucla fight fight fight\econ 144\data\SleepData.dat",header=F)
> names(sleep) <- c("age","black","case","clerical","construc","educ"," earns74","gdhlth","inlf","leis1","leis2","leis3","smsa","lhrwage","lothinc","male","marr","prot","rlxall","selfe","sleep","slpnaps","south","spsepay","spwrk75","totwrk","union","worknrm","workscnd","exper","yngkid","yrsmarr","hrwage","agesq")
> hist(age)
Error in hist(age) : object 'age' not found
Can someone explain how can I get rid of the error and plot the histogram of varibles?
Explanation / Answer
you must put age inside inverted commas
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.