{"id":199,"date":"2017-03-01T20:05:57","date_gmt":"2017-03-01T11:05:57","guid":{"rendered":"http:\/\/nakais-met.yukiarare.net\/?p=199"},"modified":"2017-03-01T20:11:13","modified_gmt":"2017-03-01T11:11:13","slug":"r%e3%81%a7%e6%99%82%e7%b3%bb%e5%88%97%e4%bd%9c%e5%9b%b3%ef%bc%8daxis-posixct","status":"publish","type":"post","link":"https:\/\/nakais-met.yukiarare.net\/?p=199","title":{"rendered":"R\u3067\u6642\u7cfb\u5217\u4f5c\u56f3\uff0daxis.POSIXct"},"content":{"rendered":"<p>R\u3067\u306f\u65e5\u6642\u8868\u8a18\u3092POSIXct\u30af\u30e9\u30b9\u306b\u5909\u63db\u3057\u3066\u3001\u65e5\u6642\u306e\u8ef8\u3092\u81ea\u52d5\u3067\u8abf\u7bc0\u3057\u3066\u4f5c\u56f3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u958f\u5e74\u306e\u3042\u308b2\u6708\u306e\u4f5c\u56f3\u3082\u3053\u308c\u3067\u81ea\u52d5\u5316\u3067\u304d\u308b\u3002<\/p>\n<p><a href=\"http:\/\/nakais-met.yukiarare.net\/wp-content\/uploads\/2017\/03\/R_POSIXaxis_example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-200\" src=\"http:\/\/nakais-met.yukiarare.net\/wp-content\/uploads\/2017\/03\/R_POSIXaxis_example-300x150.png\" alt=\"\" width=\"600\" height=\"300\" srcset=\"https:\/\/nakais-met.yukiarare.net\/wp-content\/uploads\/2017\/03\/R_POSIXaxis_example-300x150.png 300w, https:\/\/nakais-met.yukiarare.net\/wp-content\/uploads\/2017\/03\/R_POSIXaxis_example-768x384.png 768w, https:\/\/nakais-met.yukiarare.net\/wp-content\/uploads\/2017\/03\/R_POSIXaxis_example-1024x512.png 1024w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>\u3053\u306e\u56f3\u3092\u63cf\u3044\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3002<\/p>\n<p>thts &lt;- read.table(&#8220;\u30c7\u30fc\u30bf\u30d5\u30a1\u30a4\u30eb\u540d.csv&#8221;, header=TRUE, sep=&#8221;,&#8221;, na.strings=&#8221;NA&#8221;, dec=&#8221;.&#8221;, strip.white=TRUE)<\/p>\n<p>timeexpr &lt;- as.POSIXct( ( thts$serialtime &#8211; 25569 ) * 86400 , origin = &#8220;1970-01-01&#8221;, tz = &#8220;GMT&#8221;)<\/p>\n<p>timestt &lt;- as.POSIXlt( timeexpr[1] )<br \/>\ntimestt0 &lt;- as.POSIXct(ISOdatetime(timestt$year+1900,timestt$mon+1,1,0,0,0,tz=&#8221;GMT&#8221;) , origin = &#8220;1970-01-01&#8221;, tz = &#8220;GMT&#8221;)<\/p>\n<p>timeend &lt;- as.POSIXlt( max(timeexpr) )<br \/>\ntimeend0 &lt;- as.POSIXct(ISOdatetime(timeend$year+1900,timeend$mon+1,1,0,0,0,tz=&#8221;GMT&#8221;) , origin = &#8220;1970-01-01&#8221;, tz = &#8220;GMT&#8221;) + 45 * 86400<\/p>\n<p>timeend1 &lt;- as.POSIXlt( timeend0 )<\/p>\n<p>timeend2 &lt;- as.POSIXct(ISOdatetime(timeend1$year+1900,timeend1$mon+1,1,0,0,0,tz=&#8221;GMT&#8221;) , origin = &#8220;1970-01-01&#8221;, tz = &#8220;GMT&#8221;)<\/p>\n<p># Excel\u30b7\u30ea\u30a2\u30eb\u6642\u523b(1900\u5e74\u5143\u65e6\u304c0)\u2192POSIXct\u578b(1970\u5e74\u5143\u65e6\u304c0)\u3000(25569\u65e5\u5dee)<br \/>\n# tz=&#8221;GMT&#8221;\u306f\u3001\u5143\u30c7\u30fc\u30bf\u304b\u3089\u6642\u523b\u3092\u305a\u3089\u3055\u306a\u3044\u3001\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308b\u3002\u3053\u3046\u3057\u306a\u3044\u3068\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u30ed\u30b1\u30fc\u30eb\u3092\u4f7f\u3063\u3066\uff0b\uff19\u6642\u9593\u3057\u3066\u3057\u307e\u3046\u3002\u5143\u30c7\u30fc\u30bf\u304cJST\u306e\u5834\u5408\u306f\u3001\u305d\u306e\u307e\u307eJST\u3067\u6271\u3046\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n<p>png(&#8220;R_POSIXaxis_example.png&#8221;, pointsize = 48, width = 2400, height = 1200)<\/p>\n<p>par(plt = c(0.1, 0.9, 0.15, 0.85),mgp=c(2,0.5,0), xaxs=&#8221;i&#8221;, yaxs=&#8221;i&#8221;, tck=1, xaxt=&#8221;n&#8221;)<\/p>\n<p>plot(timeexpr, thts$SIRCrojo_T_C, pch=18, cex=0.2, xlim=c(timestt0, timeend2), ylim=c(-12.0, 24.0), yaxp=c(-12.0, 24.0, 6), xlab=&#8221;&#8221;, ylab=expression(paste(T[SIRC], &#8221; (&#8220;^&#8221;o&#8221;, &#8220;C)&#8221;)), main=&#8221;2013\/2014 winter&#8221; )<\/p>\n<p>par(xaxt = &#8220;s&#8221;,mgp=c(3.0,1.6,0))<\/p>\n<p>axis.POSIXct(1,at=seq(timestt0,timeend2,&#8221;months&#8221;), format = &#8220;%Y\/%m\/%d\\n%HJST&#8221;)<\/p>\n<p>dev.off()<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>R\u3067\u306f\u65e5\u6642\u8868\u8a18\u3092POSIXct\u30af\u30e9\u30b9\u306b\u5909\u63db\u3057\u3066\u3001\u65e5\u6642\u306e\u8ef8\u3092\u81ea\u52d5\u3067\u8abf\u7bc0\u3057\u3066\u4f5c\u56f3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u958f\u5e74\u306e\u3042\u308b2\u6708\u306e\u4f5c\u56f3\u3082\u3053\u308c\u3067\u81ea\u52d5\u5316\u3067\u304d\u308b\u3002 \u3053\u306e\u56f3\u3092\u63cf\u3044\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3002 thts &lt;- read.table [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,6],"tags":[],"class_list":["post-199","post","type-post","status-publish","format-standard","hentry","category-grads_r","category-6"],"_links":{"self":[{"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=199"}],"version-history":[{"count":4,"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=\/wp\/v2\/posts\/199\/revisions\/204"}],"wp:attachment":[{"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nakais-met.yukiarare.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}