2018-05-01ãã1ã¶æéã®è¨äºä¸è¦§
ãã¤ãå¿ãã¦rangeï¼ã¨ããã£ã¦ããã¡ãããseqã¨sapplyã R: Sequence Generation Shifting sands: Using apply, sapply, lapply in R > sapply(seq(0,7), function(i) { 2 ^ i }) [1] 1 2 4 8 16 32 64 128 DRY
fun1 <- function(x) { (x + 2) * (x - 4) } fun2 <- function(x) { (x + 1) * (x - 6) } v <- seq(-4, 8) plot(v, fun1(v), type="l", col="red") lines(v, fun2(v), col="blue")
# Datetimeæååã®ãã¼ã¹ > t1 <- strptime("May 11 08:42:20", format = "%b %d %H:%M:%S" 1. ) > t2 <- strptime("May 11 08:47:23", format = "%b %d %H:%M:%S") # æéã®å·®å > t2 - t1 Time difference of 5.05 mins # ç§ã§ãã > as.numeric(t2 - t1,â¦