Click here to Skip to main content
14,383,854 members
Rate this:
Please Sign up or sign in to vote.
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100