If you want to look at the dataframe, then consider using View. On Thu, Apr 8, 2010 at 11:14 AM, Paul Miller <pjmiller...@yahoo.com> wrote:
> Hello Everyone, > > I am a newbie with about a month's worth of experience using R. I've just > spent a little time learning how to work with date values. Mostly, this has > involved converting text values into dates. > > So far, I've managed to figure out how to do this in R proper using > as.Date. However, I'm still struggling with doing this using SQL and RODBC. > > In the process of learning to create date values in R proper, I noticed > some interesting behavior on the part of the data editor. At first, this led > me to believe that my efforts had been unsuccessful. The output from my R > console below illustrates this behavior. > > > test <- mydata > > test$test_date <- as.Date(test$ae_datestarted, format='%m/%d/%Y') > > class(test$test_date) > [1] "Date" > > mode(test$test_date) > [1] "numeric" > > > > fix(test) > > (At this point, I clicked on the test_date column) > > Warning: class discarded from column test_date > > > > class(test$test_date) > [1] "character" > > mode(test$test_date) > [1] "character" > > > > When I run my code, it works correctly. But when I open the data frame in > the data editor and click on the test_date column, the editor says that it > is character. And beyond that, the editor discards the class for test_date. > Should the editor do this? Or is it my fault for trying to look at test_date > in the editor in the first place? In SAS, I'm used to creating data and then > opening the dataset to look at what I've done. Maybe I shouldn't be doing > this in R though. > > Returning to the issue of converting text values to dates using SQL > (Server) and RODBC. Does anyone know how ot do this? I've been trying to do > this using things like Cast and Convert. Usually, these attempts fail. > When SQL Server does seem to be sending something back, it appears that R > cannot accept it. Any help with this problem would be greatly appreciated. > > Thanks, > > Paul > > > > __________________________________________________________________ > [[elided Yahoo spam]] > avourite sites. Download it now > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help@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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]]
______________________________________________ R-help@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.