Hi Jon,
zoo is great for tasks like this, not just for na.approx. :)
I would approach the problem like this:
library(zoo)
# put lightdata into a zoo object
z <- with(lightdata, zoo(light,
as.POSIXct(paste(date, time), format="%m/%d/%y %H:%M:%S")))
# merge the above zoo object with an "empty" z
Hi
Why you do not change date and time to POSIX object? It is simple and saves you
a lot of frustration when merging two data frames.
If you changed lightdata date and time to new column
lightdata$newdate <- strptime(paste(lightdata$date, lightdata$time, sep=" "),
format = "%d/%m/%y %H:%M:%S")
?rbind
df1 <- data.frame(matrix(rep(0,9),nrow=3))
names(df1) <- c("x1","x2","x3")
rbind(df,df1)
--- On Fri, 10/23/09, Ashta wrote:
> From: Ashta
> Subject: [R] Inserting rows
> To: "R help"
> Received: Friday, October 23, 2009, 9:44 AM
> Hi all,
>
> I have the data set df with three varaib
Try this:
rbind(df, matrix(0, 3, 3, dimnames = list(NULL, names(df
On Fri, Oct 23, 2009 at 11:44 AM, Ashta wrote:
> Hi all,
>
> I have the data set df with three varaibles,
>
> x1 x2 x3
> 1 2 5
> 2 4 1
> 5 6 0
> 1 1 2
>
> I want to insert more rows ( eg, 3 rows with value fill
4 matches
Mail list logo