Windrose开盘价和收盘价

时间:2020-07-16 13:32:02

标签: r ggplot2

我有5天的三只股票的开盘价和收盘价。

df <- structure(list(stock = c("Google", "Google", "Google", "Google", 
"Google", "Google", "Google", "Google", "Google", "Google", "Yahoo", 
"Yahoo", "Yahoo", "Yahoo", "Yahoo", "Yahoo", "Yahoo", "Yahoo", 
"Yahoo", "Yahoo", "Amazon", "Amazon", "Amazon", "Amazon", "Amazon", 
"Amazon", "Amazon", "Amazon", "Amazon", "Amazon"), day = c("Monday", 
"Monday", "Tuesday", "Tuesday", "Wednesday", "Wednesday", "Thurday", 
"Thurday", "Friday", "Friday", "Monday", "Monday", "Tuesday", 
"Tuesday", "Wednesday", "Wednesday", "Thurday", "Thurday", "Friday", 
"Friday", "Monday", "Monday", "Tuesday", "Tuesday", "Wednesday", 
"Wednesday", "Thurday", "Thurday", "Friday", "Friday"), startend = c("open", 
"close", "open", "close", "open", "close", "open", "close", "open", 
"close", "open", "close", "open", "close", "open", "close", "open", 
"close", "open", "close", "open", "close", "open", "close", "open", 
"close", "open", "close", "open", "close"), value = c(0.68, 0.67, 
0.16, 0.16, 0.28, 0.28, 0.16, 0.17, 0.36, 0.36, 0.74, 0.74, 0.13, 
0.13, 0.25, 0.25, 0.15, 0.15, 0.39, 0.39, 0.61, 0.6, 0.2, 0.21, 
0.3, 0.3, 0.21, 0.22, 0.37, 0.38)), class = "data.frame", row.names = c(NA, 
-30L))

对于这样的情节:

library(ggplot2)
data.in <- read.csv(file = "http://midcdmz.nrel.gov/apps/plot.pl?site=NWTC&start=20010824&edy=26&emo=3&eyr=2062&year=2013&month=1&day=1&endyear=2013&endmonth=12&endday=31&time=0&inst=21&inst=39&type=data&wrlevel=2&preset=0&first=3&math=0&second=-1&value=0.0&user=0&axis=1",
                    col.names = c("date","hr","ws.80","wd.80"))
p1 <- plot.windrose(spd = data.in$ws.80,
                   dir = data.in$wd.80)

如何使用每天的打开和关闭变量绘制库存数据。更具体地说,在圈子中有六个切片。一半将开放三种股票的开盘价,一周的每一天都有不同的颜色。

0 个答案:

没有答案