# zooパッケージを読み込む library(zoo) x <- read.zoo('test0.csv', sep=',', format="%Y-%m-%d %H:%M:%S", tz='Japan', col.names=c("datetime", "value")) cat("x = \n") print(x) # Plot png(filename='test0-plot.png') plot(x) dev.off()実行結果
$ Rscript test0.R Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric x = 2017-04-28 00:00:03 2017-04-28 00:00:11 2017-04-28 00:00:14 2017-04-28 00:00:20 -1.4862333 0.1039043 -1.4335332 -0.2203692 2017-04-28 00:00:37 2017-04-28 00:00:49 2017-04-28 00:00:57 2017-04-28 00:01:13 -1.3775672 -0.8206941 1.0668013 -0.8139086 2017-04-28 00:01:31 2017-04-28 00:01:32 -0.1771520 0.5120787 null device 1test0-plot.png
# zooパッケージを読み込む library(zoo) ############### # 日単位の時系列データを表示 # Date: 日付型 t = as.Date("2017-04-28") + c(1, 3, 7, 9, 14) - 1 cat("t = ", t, "\n") v <- rnorm(5) cat("v = ", v, "\n") x <- zoo(v, t) cat("x = \n") print(x) png('test1-plot.png') plot(x) dev.off() ##################### # 秒単位の時系列データを表示 # 要素数 n <- 10 # rexp(n, rate): 指数分布に従うランダム数を生成する # n: 生成する乱数の数 # rate: 比率のベクトル r <- rexp(n, rate=0.1) cat("r = ", r, "\n") # cumsum(): ベクトルの累積和 t <- cumsum(r) cat("t = ", t, "\n") # rnorm(n): 正規分布に従う乱数をn個生成する v <- rnorm(n) cat("v = ", v, "\n") # ベクトルtの各要素にPOSIXct("2017-04-28 00:00:00", tz="JST")を加える cat("POSIXct(2017-04-28 00:00:00, tz=JST) = ", as.POSIXct("2017-04-28 00:00:00", tz="JST"), "\n") t <- t + as.POSIXct("2017-04-28 00:00:00", tz="JST") cat("t = ", t, "\n") # zoo(value, time): zooオブジェクト(Z's ordered observations)を生成する # value: 値のベクトル # time: 時間のベクトル x <- zoo(v, t) cat("x = \n") print(x) # Plot lim = as.POSIXct(c("2017-04-28 00:00:00", "2017-04-28 00:05:00"), tz="JST") cat("lim = ", lim, "\n") png(filename='test1-plot1.png') plot(x, xlim=lim) dev.off()実行結果
$ Rscript test1.R Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric t = 17284 17286 17290 17292 17297 v = 0.87807 -0.1978724 2.154195 -1.168555 -0.7520462 x = 2017-04-28 2017-04-30 2017-05-04 2017-05-06 2017-05-11 0.8780700 -0.1978724 2.1541946 -1.1685551 -0.7520462 null device 1 r = 11.0301 18.67322 3.54064 14.88312 1.521852 0.3181695 13.12669 5.038134 27.43955 15.86685 t = 11.0301 29.70332 33.24396 48.12708 49.64893 49.9671 63.09379 68.13193 95.57147 111.4383 v = 1.069938 -0.1263455 -0.799708 -0.8663653 0.2562313 0.1949112 0.6599253 1.93077 -0.7650325 -1.813658 POSIXct(2017-04-28 00:00:00, tz=JST) = 1493337600 t = 1493337611 1493337630 1493337633 1493337648 1493337650 1493337650 1493337663 1493337668 1493337696 1493337711 x = 2017-04-28 00:00:11 2017-04-28 00:00:29 2017-04-28 00:00:33 2017-04-28 00:00:48 1.0699382 -0.1263455 -0.7997080 -0.8663653 2017-04-28 00:00:49 2017-04-28 00:00:49 2017-04-28 00:01:03 2017-04-28 00:01:08 0.2562313 0.1949112 0.6599253 1.9307703 2017-04-28 00:01:35 2017-04-28 00:01:51 -0.7650325 -1.8136584 lim = 1493337600 1493337900 null devicetest1-plot.png
test1-plot1.png
Casino 2021 - MapyRO
返信削除Find the best 2021 Casino list 경주 출장안마 with 상주 출장안마 972 casino photos, reviews 전라북도 출장안마 and ratings. Compare real time driving directions to the casino, game selection and software. Rating: 1.2 광주광역 출장안마 · 5,271 계룡 출장마사지 votes