Re: [R] Undefined columns selected

From: Andrew Robinson <A.Robinson_at_ms.unimelb.edu.au>
Date: Fri, 29 Apr 2011 11:56:42 +1000

Jennifer,

it looks like some of the columns that you are selecting don't exist.

What is the output of str(arc) before you run the code below?

Andrew

On Thu, Apr 28, 2011 at 04:49:41PM -0700, Jennifer Wessel wrote:
> This is part of my program. I am getting an error, that I cannot figure out, any help would very much appreciated, thanks.
>
> # subset variables
> arc <- arc[,c("SNAP", "code", "ncode", "var", "n_total")]
> Error in `[.data.frame`(arc, , c("SNAP", "code", "ncode", :
> undefined columns selected
> arc$N_eff <- with(arc, ifelse(var > 1, n_total, var * n_total))
> Error in storage.mode(test) <- "logical" : object 'var' not found
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Andrew Robinson  
Program Manager, ACERA 
Department of Mathematics and Statistics            Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia               (prefer email)
http://www.ms.unimelb.edu.au/~andrewpr              Fax: +61-3-8344-4599
http://www.acera.unimelb.edu.au/

Forest Analytics with R (Springer, 2011) 
http://www.ms.unimelb.edu.au/FAwR/
Introduction to Scientific Programming and Simulation using R (CRC, 2009): 
http://www.ms.unimelb.edu.au/spuRs/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 29 Apr 2011 - 02:04:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 29 Apr 2011 - 02:10:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive