Click here to Skip to main content
15,895,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to subsample a data set in R. When I do this I get an error stating "Error in `[.data.frame`(body, , b, w, h, a) : unused arguments (h, a)" What can be causing this?

<pre>body=read.table("BODY_FAT.txt")
d=as.numeric(as.character((body$V1)))
bfp<-(495/d)-450
bfp
realBFP=round(bfp,digits=1)
realBFP[realBFP<0]<-0
realBFP[realBFP>100]<-100
data.frame(body$V2,realBFP)
b=as.numeric(as.character(body$V2))
w=as.numeric(as.character((body$V4)))
h=as.numeric(as.character(body$V5))
a=as.numeric(as.character(body$V8))
body[,b,w,h,a]
body








What I have tried:

I am not sure what is causing this so I really haven't tried anything new.
Posted
Comments
CHill60 30-Jan-19 6:41am    
body is not using the parameters h and a - you're passing them in but not using them

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900