以下の内容はhttps://seinzumtode.hatenadiary.jp/entry/2025/08/11/212300より取得しました。


Weather stationのプロット

> df<-read.csv("~/Documents/R_workspace/weather_station/weatherdata.csv")
> df$ts <- as.POSIXct(df$ts, format =  "%Y-%m-%dT%H:%M:%SZ", tz = "UTC")
> humid <- ggplot(df, aes(x=ts,y=humidity_sht))+geom_line(color='deeppink')
> p  <- ggplot(df, aes(x=ts,y=press_bmx))+geom_line(color='deeppink')
> wind <- ggplot(df, aes(x=ts,y=wind_spd))+geom_line(color='deeppink')
> temp <- ggplot(df, aes(x=ts,y=temp_bmx))+ geom_line(color='deeppink')
> gridExtra::grid.arrange(temp, p, humid, wind)

別のやり方
Rで時系列データの読込み - how to code something

df1 <- read.csv("~/Documents/R_workspace/weather_station/weatherdata.csv")
df1$ts <- as.POSIXct(df1$ts, format =  "%Y-%m-%dT%H:%M:%SZ", tz = "UTC")
df2 <- melt(df1,id="ts",measure=c("temp_bmx","press_bmx","humidity_sht","wind_spd"))
ggplot(df2,aes(x=ts,y=value,col=variable))+geom_line()

%スケールが似ている温度と湿度のみ取り出す
 df2 <- melt(df1,id="ts",measure=c("temp_bmx","humidity_sht"))
 ggplot(df2,aes(x=ts,y=value,col=variable))+geom_line()




以上の内容はhttps://seinzumtode.hatenadiary.jp/entry/2025/08/11/212300より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14