[R] MULTIPLE LEVELS for a SINGLE VALUE in a dataframe, how do I remove these?

elle mlavis at syr.edu
Tue Apr 1 20:34:34 CEST 2014


I have a series of dates and times in one column.  They are all in the format
"%m/%d/%Y %H:%M:%S"; however, they are character values.

I have a number of problems:
1) if I use antdist$ts[1] to just examine the FIRST value of the timestamp
(ts) column, it shows that there are 144873 Levels, and it should only have
1 Level with the first value of "6/1/2013 08:07:39"; how do I delete the
remaining levels?
2) I need to change this column to a factor, so that I can use it in
functions and graph it, etc.  It's useless in this format.  I think that
once I can remove the levels, I can use as.Date or as.POSIXct to do this,
but I need to figure out what's happening in the first part of the question.

Here's the R code for just looking at the first value of the timestamp
column:
> antdist$ts[1]
[1] 6/1/2013 08:07:39
144873 Levels: 6/1/2013 08:07:39 6/1/2013 08:07:41 6/1/2013 08:07:43
6/1/2013 08:07:45 ... 8/2/2013 11:47:51

Here's a photo of what the first few rows of the timestamp column look like
using View(antdist):
<http://r.789695.n4.nabble.com/file/n4687977/Capture.jpg> 

Thank you, thank you, thank you for your help!



--
View this message in context: http://r.789695.n4.nabble.com/MULTIPLE-LEVELS-for-a-SINGLE-VALUE-in-a-dataframe-how-do-I-remove-these-tp4687977.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list