Skip to content
Back to formatted view

Raw Message

Message-ID: <alpine.DEB.2.00.1012251400340.9437@springer.Berkeley.EDU>
Date: 2010-12-25T22:00:57Z
From: Phil Spector
Subject: Extracting a dataframe column as a dataframe
In-Reply-To: <1293305448512-3163920.post@n4.nabble.com>

> x['price']
   price
1 321.0
2 323.5

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu


On Sat, 25 Dec 2010, Dimitri Shvorob wrote:

>
>> x = structure(list(time = structure(c(1020232904.818, 1020232904.818
> ), class = c("POSIXt", "POSIXct"), tzone = ""), price = c(321,
> 323.5)), .Names = c("time", "price"), row.names = 1:2, class = "data.frame")
>> x1 = x[,c("price")]
>> dput(x1)
> c(321, 323.5)
>
> Is there similar syntax that gets "price" as a (single-column) dataframe? (I
> know that I can use "subset(... select = ...)")..
> Thank you.
> -- 
> View this message in context: http://r.789695.n4.nabble.com/Extracting-a-dataframe-column-as-a-dataframe-tp3163920p3163920.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>