

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


library(dplyr)
setwd("/cloud/project/Lab 6")
ShrubData <- read.csv("shrub-volume-data.csv") #hand in q select(ShrubData, experiment, site) #hand in q mutate(ShrubData, length*width) #hand in q arrange(ShrubData,width) #hand in q arrange(ShrubData, length) #hand in q filter(ShrubData, height > 5) #hand in q filter(ShrubData, height > 4, width > 2) #hand in q filter(ShrubData, site ==1|site ==2) #hand in q filter(ShrubData,! is.na(width)) #Part 2.
maxtemp <-read.csv("max-temperature.csv") filter(maxtemp, !is.na(Max.Temp.C)) #hand in q
filterdata <- filter(maxtemp, !is.na(Max.Temp.C))
by_month <- group_by(filterdata,Month) data2 <- summarize (by_month,mean(Max.Temp.C)) print(data2) #part 2.
#load data number_of_birds <- c(28, 32, 1, 0, 10, 22, 30, 19, 145, 27, 36, 25, 9, 38, 21, 12, 122, 87, 36, 3, 0, 5, 55, 62, 98, 32, 900, 33, 14, 39, 56, 81, 29, 38, 1, 0, 143, 37, 98, 77, 92, 83, 34, 98, 40, 45, 51, 17, 22, 37, 48, 38, 91, 73, 54, 46, 102, 273, 600, 10, 11)
length(number_of_birds)
sum(number_of_birds)
#hand in q min(number_of_birds)
#hand in q max(number_of_birds)
#hand in q number_of_birds[61]
number_of_birds[42]
#hand in q surveys <- read.csv("surveys.csv") #hand in q survey_new <-filter(surveys, !is.na(weight)) #hand in q survey_new_2 <- select(survey_new,year,month,day,species_id,weight)