-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode Script.Rmd
More file actions
36 lines (31 loc) · 1.08 KB
/
Code Script.Rmd
File metadata and controls
36 lines (31 loc) · 1.08 KB
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
---
title: "Homework Code Script"
author: "Carlisha Hall"
date: "March 12, 2019"
output: github_document
---
```{r}
#read in ozone data
suppressMessages(library(readr, warn.conflicts = FALSE, quietly=TRUE))
suppressMessages(library(tidyverse, warn.conflicts = FALSE, quietly=TRUE))
o3.filenames <- list.files("C://Users//Carlisha Hall//Desktop//Homework-6-//Homework Data//ca_ozone", pattern = ".txt")
suppressMessages(o3.filelist <- lapply(o3.filenames, read_delim, delim = "|"))
names(o3.filelist) <- gsub(".txt","", o3.filenames)
o3.filelist
```
```{r}
#Summarize ozone data
suppressMessages(library(data.table, warn.conflicts = FALSE, quietly=TRUE))
daily <- o3.filelist %>%
rbindlist() %>%
group_by(site = as.factor(site), date) %>%
summarize(o3 = mean(obs, na.rm = TRUE))
daily
```
```{r}
#read in location excel file
suppressMessages(library(tidyverse, warn.conflicts = FALSE, quietly=TRUE))
suppressMessages(library(readxl, warn.conflicts = FALSE, quietly=TRUE))
loc <- read_excel("C://Users//Carlisha Hall//Desktop//Homework-6-//Homework Data//ca_ozone//location.xls")
loc
```