-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
120 lines (120 loc) · 6.25 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
library(readxl)
armourdale <- read_excel("Wind_Analyses/armourdale.xlsx")
install.packages("rlang")
install.packages("rlang")
library(rlang)
library(readxl)
library(readxl)
armourdale <- read_excel("~/GitHub/Community_Air_Montoring/Wind_Analyses/armourdale.xlsx")
View(armourdale)
windRose(armourdale)
#import libraries and install packages
library(readxl)
library(openair)
#Import data
armourdale <- read_excel("~/GitHub/Community_Air_Montoring/Wind_Analyses/armourdale.xlsx")
View(armourdale)
head(armourdale)
summary(armourdale)
str(armourdale)
nrow(armourdale)
windRose(armourdale)
windRose(armourdale, ws = "ws", wd = "wd",breaks=c(0, 2, 5,8, 11, 17), auto.text=FALSE, paddle=FALSE, annotate=FALSE, grid.line=5, key = list(labels = c(">0-2", ">2-5", ">5-8", ">8-11", ">11-17")), key.footer = "WSP (m/s)", key.position = "bottom",par.settings=list(axis.line=list(col="lightgray")), col = c("#4f4f4f", "#0a7cb9", "#f9be00", "#ff7f2f", "#d7153a"))
#Import data
armourdale <- read.csv2("https://raw.githubusercontent.com/lourdesvera/Community_Air_Montoring/master/Wind_Analyses/Armourdale_10yrs.csv")
head(armourdale)
armourdale
read.csv2
#Import data
armourdale <- read.csv2("https://raw.githubusercontent.com/lourdesvera/Community_Air_Montoring/master/Wind_Analyses/Armourdale_10yrs.csv", header = TRUE, stringsAsFactors = FALSE )
armourdale
#Import data
armourdale <- read.csv2("https://raw.githubusercontent.com/lourdesvera/Community_Air_Montoring/master/Wind_Analyses/Armourdale_10yrs.csv", header = TRUE, stringsAsFactors = FALSE )
armourdale
#Import data
armourdale <- read.csv2("https://raw.githubusercontent.com/lourdesvera/Community_Air_Montoring/master/Wind_Analyses/Armourdale_10yrs.csv", header = TRUE, sep = ",", stringsAsFactors = FALSE )
armourdale
summary(armourdale)
str(armourdale)
nrow(armourdale)
windRose(armourdale)
library(lubridate)
#change df name for cleaning
ad <- armourdale
#Concatenate day, month, year and convert that column into posixct date/time
ad$date <- make_date(year = ad$YEAR, month = ad$MO , day = ad$DY)
head(ad$date)
install.packages("weathermetrics")
library(weathermetrics)
#Convert Celsius to Fahrenheit
celsius.to.fahrenheit(ad$T2M, round = 2)
#rename columns
colnames(ad) = c("Year", "Month", "Day", "Temperature", "WindSpeed", "WindDirection")
#change some column formats
ad$Temperature <- as.numeric(ad$Temperature)
ad$WindSpeed <- as.numeric(as$WindSpeed)
#rename columns
colnames(ad) = c("Year", "Month", "Day", "Temperature", "WindSpeed", "WindDirection")
#rename columns
colnames(ad) = c("Year", "Month", "Day", "Temperature", "WindSpeed", "WindDirection")
#change some column formats
ad$Temperature <- as.numeric(ad$Temperature)
ad$WindSpeed <- as.numeric(ad$WindSpeed)
ad$WindDirection <- as.numeric(ad$WindDirection)
#Concatenate day, month, year and convert that column into date/time format
ad$date <- make_date(year = ad$YEAR, month = ad$MO , day = ad$DY)
#Concatenate day, month, year and convert that column into date/time format
ad$date <- make_date(year = ad$Year, month = ad$Month , day = ad$Day)
head(ad$Date)
#Concatenate day, month, year and convert that column into date/time format
ad$Date <- make_date(year = ad$Year, month = ad$Month , day = ad$Day)
head(ad$Date)
library(weathermetrics)
#Convert Celsius to Fahrenheit
celsius.to.fahrenheit(ad$Temperature, round = 2)
library(weathermetrics)
#Convert Celsius to Fahrenheit
ad$Temperature <- celsius.to.fahrenheit(ad$Temperature, round = 2)
summary(ad)
str(armourdale)
nrow(armourdale)
windRose(ad)
str(ad)
nrow(ad)
windRose(ad)
windRose(ad, ws = "WindSpeed", wd = "WindDirection",breaks=c(0, 2, 5,8, 11, 17), auto.text=FALSE, paddle=FALSE, annotate=FALSE, grid.line=5, key = list(labels = c(">0-2", ">2-5", ">5-8", ">8-11", ">11-17")), key.footer = "WSP (m/s)", key.position = "bottom",par.settings=list(axis.line=list(col="lightgray")), col = c("#4f4f4f", "#0a7cb9", "#f9be00", "#ff7f2f", "#d7153a"))
#Concatenate day, month, year and convert that column into date/time format
ad$date <- make_date(year = ad$Year, month = ad$Month , day = ad$Day)
head(ad$date)
windRose(ad)
windRose(ad, ws = "WindSpeed", wd = "WindDirection",breaks=c(0, 2, 5,8, 11, 17), auto.text=FALSE, paddle=FALSE, annotate=FALSE, grid.line=5, key = list(labels = c(">0-2", ">2-5", ">5-8", ">8-11", ">11-17")), key.footer = "WSP (m/s)", key.position = "bottom",par.settings=list(axis.line=list(col="lightgray")), col = c("#4f4f4f", "#0a7cb9", "#f9be00", "#ff7f2f", "#d7153a"))
windRose(ad, WindSpeed = "Wind Speed", WindDirection = "Wind Direction",breaks=c(0, 2, 5,8, 11, 17), auto.text=FALSE, paddle=FALSE, annotate=FALSE, grid.line=5, key = list(labels = c(">0-2", ">2-5", ">5-8", ">8-11", ">11-17")), key.footer = "WSP (m/s)", key.position = "bottom",par.settings=list(axis.line=list(col="lightgray")), col = c("#4f4f4f", "#0a7cb9", "#f9be00", "#ff7f2f", "#d7153a"))
windRose(ad, WindSpeed = "WindSpeed", WindDirection = "WindDirection",breaks=c(0, 2, 5,8, 11, 17), auto.text=FALSE, paddle=FALSE, annotate=FALSE, grid.line=5, key = list(labels = c(">0-2", ">2-5", ">5-8", ">8-11", ">11-17")), key.footer = "WSP (m/s)", key.position = "bottom",par.settings=list(axis.line=list(col="lightgray")), col = c("#4f4f4f", "#0a7cb9", "#f9be00", "#ff7f2f", "#d7153a"))
#rename columns
colnames(ad) = c("Year", "Month", "Day", "Temperature", "ws", "wd")
#change some column formats
ad$Temperature <- as.numeric(ad$Temperature)
ad$WindSpeed <- as.numeric(ad$WindSpeed)
#change some column formats
ad$Temperature <- as.numeric(ad$Temperature)
ad$ws <- as.numeric(ad$ws)
ad$wd <- as.numeric(ad$wd)
#Concatenate day, month, year and convert that column into date/time format
ad$date <- make_date(year = ad$Year, month = ad$Month , day = ad$Day)
head(ad$date)
library(weathermetrics)
#Convert Celsius to Fahrenheit
ad$Temperature <- celsius.to.fahrenheit(ad$Temperature, round = 2)
windRose(ad)
library(dplyr)
windRose(ad)
windRose(ad)
windRose(ad)
View(ad)
#prep for wind rose
ad_wr <- ad[,c("ws", "wd")]
windRose(ad_wr)
windRose(ad_wr, ws = "ws", wd = "wd",breaks=c(0, 2, 5,8, 11, 17), auto.text=FALSE, paddle=FALSE, annotate=FALSE, grid.line=5, key = list(labels = c(">0-2", ">2-5", ">5-8", ">8-11", ">11-17")), key.footer = "WSP (m/s)", key.position = "bottom",par.settings=list(axis.line=list(col="lightgray")), col = c("#4f4f4f", "#0a7cb9", "#f9be00", "#ff7f2f", "#d7153a"))
#Add title
#add legend
#add timespan