#first import your two data sets and save as a named "dataframe" #They should be saved in your Working Directory with a short, meaningful file name NYBG_SP1 <- read.csv("zizia_sampleData.csv") #you can re-name the left hand ("NYBG_SP1") to whatever you want, but you will have to change all of the following code as well. #The part if quotations should be your file name NYBG_SP2 <- read.csv("alliaria_sampleData.csv") #you can re-name the left hand ("NYBG_SP1") to whatever you want, but you will have to change all of the following code as well. #The part if quotations should be your file name #Now, do a bit of investigating for the years represented in your data length(na.omit(NYBG_SP1$year)) #This will give you the number of rows that contain a value; e.g., your sample size summary(NYBG_SP1$year) #This will report the lowest, median, mean, and maximum values for the varaible "year" within the dataframe "NYBG_SP1" #Figure out how many decades are represented in your data #(Max - Min)/10 = number of decades #Use this for the "breaks" below #make a histogram of specimen collection years for each species h <- hist(NYBG_SP1$year, main = "Title", #Replace "title" with a meaningful header for your figure xlab = "x-axis label", #Replace "x-axis label" with an appropriate x-axis label xlim = c(1800,2020), #Replace these numbers with your min and max years ylim = c(0, 20), #You'll come back to this breaks = 17) #Experiment with this number, perhaps replace this numbers with your number of represented decades #Select and run everything within "h <- hist(...)" #Figure out how many observations are in the largest category h$counts #output is a list of the number of observations within each category #In the output, find the largest number. #Go back to the above histogram code, and alter the ylim parameter to fit your tallest bar #Re-run the histogram code with your altered y-axis limits #Add labels to your histogram text(h$mids, h$counts, labels = h$counts, adj = c(0.5, -0.5)) #Export your histogram as an image for use in your report #Repeat the above with your second species: Change every instance of "NYBG_SP1" to "NYBG_SP2" #Then, use these representations of the data (two histograms) to answer your research question.