2
が見つかりません、下のリンクからコードとりながら、私は温度プロットにしようとしています: https://cran.r-project.org/web/packages/ggjoy/vignettes/gallery.html温度プロット:FUNでのエラー(X [i]が]、...):オブジェクト 'Y'
をここで著者は月の軸としてy軸を使用するが、私は温度軸として月の軸とy軸とx軸を使用します。
データがfoloowingリンクからダウンロードすることができます: https://drive.google.com/file/d/0ByOfjCmqEilLYndpOWJyZXhPVUk/view
コードは以下のとおりである:
enter code here
library(ggjoy)
library(hrbrthemes)
library(viridis)
setwd <- 'C:/Users/Data/'
weather.raw <- read.csv(file="nebraska-2016.csv", header=TRUE, sep=",")
weather.raw$month<-months(as.Date(weather.raw$Date))
weather.raw$months<-
factor(rev(weather.raw$month),levels=rev(unique(weather.raw$month)))
mins<-min(weather.raw$Min.TemperatureF)
maxs<-max(weather.raw$Max.TemperatureF)
ggplot(weather.raw, aes(x = months , y = Mean.TemperatureF, fill = ..y..)) +
geom_joy_gradient(scale = 1, rel_min_height = 0.01, gradient_lwd = 1.) +
scale_x_discrete(expand = c(0.01, 0)) +
scale_y_continuous(expand = c(0.01, 0)) +
scale_fill_viridis(name = "Temp. [°C]", option = "C") +
labs(title = 'Temperatures',
subtitle = 'Histogram of Mean Temperatures (°F) - 2016') +
theme_joy(font_size = 13, grid = TRUE) + theme(axis.title.x = element_blank())
それは、次のエラーが発生します。 FUNで
エラー(X [i]が]、...):オブジェクト 'Y'
を見つけていない、あなたが読むために使用するコマンドを入力してくださいURLからのデータ –
リンクから直接.csvファイルとしてデータをダウンロードできます。 –
私もコードを更新しました。 –