Hi,
I have the following issue. The dataframe df has a column (Date1) supposed
to be a date but read as a factor. There are two types of values in the
same column Date1
Type 1 are datetime like "5/23/2008 0:00:00"
Type 2 have no time like "1/10/13".
When I apply the following to the date column
Hi Jim,
I got an error
> df$Date2<-
+ as.POSIXct(as.character(df$Date1, format = "%m/%d/%Y %H:%M:%S"))
Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
On Sun, Feb 2, 2014 at 9:08 PM, Jim Lemon wrote:
> On 02/03/201
Thank you Jeff. I had to go back to excel and format the column from there.
Thank you everyone,
Yolande
On Sun, Feb 2, 2014 at 9:51 PM, Yolande Tra wrote:
> Hi Jim,
>
> I got an error
> > df$Date2<-
> + as.POSIXct(as.character(df$Date1, format = "%m/%d
Hi
I got the following error using as.xts
Error in xts(x, order.by = order.by, frequency = frequency, ...) :
NROW(x) must match length(order.by)
Here is how the data looks like
> d1 <- read.csv(file.path(dataDir,"AppendixA-FishCountsTable-2009.csv"),
as.is=T)
> d1[1:3,]
dive_id date time
Hello,
Attached is the file created from as.xts. After submitting the following
code, I got an error. Please help. Thanks.
diveCond <- data.frame(matrix(0, nrow=61, ncol=17))
names(diveCond) <- c("dive_id", "timestamp", "visability", "r_wvht",
"r_dpd", "r_apt", "r_mwd", "r_wtmp", "l_salinity", "l_
I was wondering why I get instead of the timestamp in the following.
Thanks.
> dataDir <- file.path(wd)
> localRaw <- read.csv(file.path(dataDir,"LOCAL.csv"), as.is=T,stringsAsFactors
= FALSE)
> localRaw[1:2,]
Year Month Day hour minute second Temp1mab Temp7mab Temp14mab Salinity1mab
1 2009
Hello,
I have the following loop for two data sets: diveData_2008 and
diveData_2009. It uses two other data: diveCond_all and fishTable. The
problem is at the point to identify the dive_id for the given index (index
is timestamp). It keeps on saying
for the1st loop
Error in fishReport$dive_id[i] <
x27;m trying to run the code you submitted, but I don't have a function
> called index().
>
> Jean
>
>
> Yolande Tra wrote on 07/18/2012 08:47:04 AM:
>
>
> > Hello,
> >
> > I have the following loop for two data sets: diveData_2008 and
> > diveDa
ta_**2008[i,]))
> thisIndex <- as.POSIXct(thisIndex)
> dive_id <- diveCond_all$dive_id[diveCond_**all$timestamp ==
> thisIndex]
> #
> [... etc ...]
>
> And the same in the 2009 loop.
>
> I think this is it.
>
> Good luck,
>
> Rui Barr
Hello,
I have the following design, counts were collected at different transects,
different depths and different sites at different times. Time is continuous
and assumed to be random, all the others are categorical fixed where
transect is nested within depth which is nested within site.
I would
Hello,
I would like to convert date as a factor to represent time in a repeated
measure situation in the following code. How would I do that?
> d <- read.csv(file.path(dataDir,"data.csv"), as.is=T,stringsAsFactors =
FALSE)
> d[1:2,]
id date ab c y
1
Thanks,
Y
On Fri, Jul 20, 2012 at 11:47 AM, R. Michael Weylandt <
michael.weyla...@gmail.com> wrote:
> d$date <- factor(d$date)
>
> Best,
> Michael
>
> On Fri, Jul 20, 2012 at 9:44 AM, Yolande Tra
> wrote:
> > Hello,
> >
> > I would like to
ep="",header=TRUE)
> dat1$date<-with(dat1,as.factor(date))
> dat1
> id date a b c y
> 1 1 8/6/2008 Red 15 B 22
> 2 1 8/6/2008 Green 15 B 22
> is.factor(dat1$date)
> [1] TRUE
> A.K.
>
>
>
> - Original Message -
> F
Hello,
I looked in the R-help but could not find an archive addressing the
following. I would like to convert a character to numeric after reading a
file with RDS extension. After using as.numeric, I checked if it is
numeric. It was not converted. Please help.
Here is my code
>Report <- readRDS(
or w/ 1 level "08/06/2008": 1 1
> #$ time : Factor w/ 1 level "8:49:00": 1 1
> #$ species: Factor w/ 2 levels "S.atrovirens",..: 2 1
> #$ count : Factor w/ 2 levels " 1","15": 2 1
> #$ size : Factor w/ 2 levels "23"," 6&
Hello,
This should be pretty simple but I cannot get it right. Please point to the
right code. Thanks.
> last <- read.csv(file.path(dataDir,"plot1.csv"), as.is=T,stringsAsFactors
= FALSE)
> last
dater_wvht
18/6/2008 0.977
28/8/2008 0.773
3 8/11/2008 1.483
4 8/
, 1.577, 1.39,
>> 0.78, 0.838, 1.77, 1.295, 2.41, 1.317, 1.3075, 1.39,
>> 1.633, 1.2416667, 1.395, 0.863, 2.79, 1.0325, 1.965,
>> 1.78, 1.567, 1.05, 1.463, 1.24, 1.0075, 1.605, 1.8475
>> )), .Names = c("date", "r_wvht"), cl
, Rui Barradas wrote:
> Hello,
>
> It only gives that error if you don't
>
>
> last$date <- as.Date(last$date, format="%m/%d/%Y")
>
> You must have dates, not character values.
> Try it, then make a zoo object, then plot it.
>
> Rui Barradas
>
&
> ix <- seq(1, length(tt), length.out=8)
> axis(side = 1, at = tt[ix], labels = FALSE)
> labs <- format(tt, "%Y-%b-%d")
> axis(side = 1, at = tt[ix], labels = labs[ix], tcl = -0.7, cex.axis = 0.7,
> las=2)
>
>
> It looks better, but I wouldn't risk "go
08-08-27", "2008-08-28", "2008-08-31","2008-09-02",
"2008-09-03","2008-09-04","2008-09-05","2008-09-08","2008-09-11")))
plot(z, xaxt="n")
> plot(z, xaxt="n",xlab="",ylab="&qu
Hi,
I was trying to run the following, where the labels on the x axis are dates
and need to be converted to characters. It did not work. Any help would be
appreciated. Thanks.
>
text(axTicks(1),par("usr)[3]-2,srt=45,adj=1,labels=as.character(c("2008-01-08","2008-08-10","2008-08-22","2008-09-03",
Thanks for the tip for future typos.
Yolande
On Wed, Aug 1, 2012 at 1:38 PM, David Winsemius wrote:
>
> On Aug 1, 2012, at 9:04 AM, Yolande Tra wrote:
>
> Hi,
>>
>> I was trying to run the following, where the labels on the x axis are
>> dates
>> and need t
Hi,
Here is my data, the first 10 rows
> u=regCond_all[1:10,]
> dput(u)
structure(c(999, 999, 999, 999, 999, 999, 999, 999, 999, 999,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 1.9, 2, 1.97, 1.99, 1.83, 1.78, 1.6, 1.52, 1.52,
1.36, 10.53, 9.88, 9.88, 10.53, 10
' not found
> > u=regCond_all[1:10,]
> Error: object 'regCond_all' not found
>
>
> From a glance, I guess you should have posted with "u" in place of
> regCond_all for the loop.
>
> A.K.
>
> - Original Message -
> From: Yolande
99 99
>
Thanks,
Y
On Fri, Aug 3, 2012 at 4:35 PM, Sarah Goslee wrote:
> Yolande,
>
> Please send your message to the R-help email list too, not just to me.
>
> On Fri, Aug 3, 2012 at 4:28 PM, Yolande Tra wrote:
> > Here is the description
> > I am trying t
"GST", "WVHT", "DPD", "APD", "MWD", "PRES", "ATMP", "WTMP",
"DEWP", "VIS", "TIDE")))
Thank you for your patience.
Y
On Fri, Aug 3, 2012 at 4:56 PM, Sarah Goslee wrote:
> Whe
<- regCond_all$DPD[ind]
> diveCond$r_apt[i] <- regCond_all$APD[ind]
> diveCond$r_mwd[i] <- regCond_all$MWD[ind]
> diveCond$r_wtmp[i] <- regCond_all$WTMP[ind]
> }
>
> # this also runs
> i <- 10
> thisStamp <- as.POSIXct(strptime(diveCond$timestamp[i],
27 matches
Mail list logo