Example as below:
> a <- c(Sys.Date(), Sys.Date()+1)
> a
[1] "2017-02-09" "2017-02-10"
> day(a[c(F,F)])
integer(0)
> day(a[c(F,F)]) <- 10
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 0, 1
Whereas in normal R functions, it should just do nothing and do not yield an error:
> b <- 1:2
> b[c(F,F)]
numeric(0)
> b[c(F,F)] <- 10
> b
[1] 1 2
Example as below:
Whereas in normal R functions, it should just do nothing and do not yield an error: