Hi,
although it takes some 10 minutes to do the calculation (the original
dataframe has more than 100 000 rows..), it seems to work ok.
Thanks for your time and help,
Zuzana
On 25 March 2013 15:37, Rui Barradas wrote:
> Hello,
>
> I believe the following solves your problem. It's a bit more co
Hello,
I believe the following solves your problem. It's a bit more complicated
but with the sample dataset you've provided the result is as wished.
tmp <- lapply(split(subz, subz$time), function(x) {
i1 <- which(as.character(x$fix) == "noon")[1]
i2 <- which(as.character(x$fi
Hi Rui,
thank you for your code, but unfortunately it doesn't work correctly. What
I got is this:
> subz
jultimedtime fixddawnddusk day
101608 15006 2011-02-01 19:14:49 19.24694 noon 7.916667 19.88333 1
101609 15006 2011-02-01 19:24:49 19.41361 mid
Hi,
To Mason:
I like your idea with reshaping the dataframe. I've read the paper and
checked the help for the "cast" function, but I wasn't able to reshape it
to wanted form, which as you mentioned would be (column names):
jul timedtime ddawn.noon ddawn.midnight ddusk.noon ddusk.midnigh
It sounds like, although your "noon" and "midnight" data are separate rows,
they are not fully independent. If I understand correctly, the operation
you want to perform would be simple if you had (at least temporarily) a
single row with columns ddawn.midnight, ddusk.midnight, ddawn.noon,
ddusk.noon
Hello,
Try the following.
idx <- which(subz$fix == "noon")
if(idx[length(idx)] == nrow(subz)) idx <- idx[-length(idx)]
subz$day[idx + 1] <- subz$day[idx]
Hope this helps,
Rui Barradas
Em 22-03-2013 18:18, zuzana zajkova escreveu:
Hi,
I would appreciate if somebody could help me with this
Hi,
I would appreciate if somebody could help me with this small issue...
I have a dataframe like this (originaly has more than 100 000 rows):
> subz
jultimedtime fixddawnddusk day
101608 15006 2011-02-01 19:14:49 19.24694 noon 7.916667 19.88333 1
1
7 matches
Mail list logo