This afternoon I will work on that.
I am thinking to stick to Jim's algorithm, changing the hours related to 40 and
50 mins. If I add one hour to them, everything should work correctly, because
wind data at 40, 50 and 00 would have exactly the same hours.
This would not be elegant, but efficient.
Dear all
I try to make fviz_pca_biplot with 2 (or more) legends. Below is data and
the code, which gives one legend (colour) for coating variable and correctly
shows triangles and circles for size variable. But this is not shown in the
legend. Hopefully somebody could help.
And before you ask, I
Beware of missing or extra records with these approaches. Also may be tricky to
get the time aligned to the hour properly.
On December 6, 2020 9:12:01 PM PST, Richard O'Keefe wrote:
>To be honest, I would do this one of two ways.
>
>(1) Use ?decimate from library(signal),
>decimating by a fa
To be honest, I would do this one of two ways.
(1) Use ?decimate from library(signal),
decimating by a factor of three.
(2) Convert the variable to an (n/3)*3 matrix using
as.matrix then use rowMeans or apply.
On Thu, 3 Dec 2020 at 06:55, Stefano Sofia
wrote:
> Dear list users,
> I hav
Hi,
Perhaps this might work for you. It leverages findInterval() and a
simple look-up-table of times to do the grouping. I made it return NA
when computing the mean when there are fewer than the three
observations.
Cheers,
Ben
n <- 144
x <- data.frame(
datetime = seq(from = as.POSIXct("2018-
Sigh. Don't use integer division AND ceiling.
ceiling_dtmN <- function( dtm, mins ) {
tm_base <- as.POSIXct( trunc( min( dtm ), units = "days" ) )
x <- as.numeric( dtm - tm_base, units = "mins" )
xceil <- ceiling( x / mins ) * mins
tm_base + as.difftime( xceil, units = "mins" )
}
On Sun,
Hi Stefano
I think either of these does what you need...
1: This gets the interval column as you want it, but utilises the lubridate
package:
library(lubridate)
mydf$interval = ceiling_date(mydf$data_POSIX, unit="30 minutes”)
2: Alternative in base R is a bit more long winded: convert the da
I usually roll my own:
---
Sys.setenv( TZ = "GMT" )
ssdf$Dtm <- with( ssdf
, as.POSIXct( paste( date_POSIX, time_POSIX ) )
)
ceiling_dtmN <- function( dtm, mins ) {
tm_base <- as.POSIXct( trunc( min( dtm ), units = "days" ) )
x <- as.numeric( dtm - tm_
Hi Jim.
I studied and implemented your solution in details. The idea is great, but
after a sharp revision I came to the conclusion that unfortunately it des not
work correctly: for the "am" side (10, 20, 30 minutes) it works well because
the hour is exactly the same, while for the "pm" side (40,
All:
I did not want to bother R folks for an R Bugzilla account, so I'll just
note what appears to be a documentation bug here
In R version 4.0.3, ?anyDuplicated says:
"anyDuplicated(.) is a “generalized” more efficient shortcut for
any(duplicated(.)).
However, anyDuplicated returns an integer
10 matches
Mail list logo