[R] Re: object is not subsetable error (was No Subject)

John Fox jfox at mcmaster.ca
Tue Mar 5 14:46:43 CET 2002


At 05:59 PM 3/4/2002 -0800, Francisco J Molina wrote:
>I get this error in one of my R programs and I have no idea what it is.
>Any hint?
>
>Error in "[<-"(*tmp*, , 1, value = Stat[1:numberSamples]) :
>         object is not subsetable

Dear Francisco,

It's hard to know what specifically caused the error without more
information, but in general you see this kind of error message when you try
to replace an element in an object, such as a function, that can't be
subscripted. For example,

         > myfn <- function(x) x
         > myfn[1] <- 1
         Error in "[<-"(*tmp*, 1, value = 1) : object is not subsetable

If it's not obvious where the problem is occurring, I suggest that you use
the debugging tools in R, such as debug, to pinpoint the location of the
error. It should then be clear what's causing the problem.

I hope that this helps,
  John
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list