=3+4 x
My Final Project Template
Subtitle here if desired
Introduction
[~ 200 words]
Clearly stated background and questions / hypotheses / problems being addressed. Sets up the analysis in an interesting and compelling way. Include figures if you like.
Materials and methods
[~ 200 words]
Narrative: Clear narrative description of the data sources and methods. Includes data from at least two sources that were integrated / merged in R.
Code: The code associated with the project is well organized and easy to follow. Demonstrates mastery of R graphics and functions.
Data: The underlying data are publicly accessible via the web and downloaded/accessed within the Rmd script. If you want to use your own data, you must make it available on a website (e.g. Figshare) so that others are able to re-run your code.
You can do bullets like this:
- The first most important thing
- The second most important thing
- The third most important thing
You can do numbers like this:
- The first most important thing
- The second most important thing
- The third most important thing
See http://rmarkdown.rstudio.com/ for all the amazing things you can do.
Here’s my first code chunk.
Refer to output in your narrative like this: x=7 .
Load any required packages in a code chunk (you may need to install some packages):
library(tidyverse)
library(leaflet)
library(kableExtra)
library(htmlwidgets)
library(widgetframe)
::opts_chunk$set(widgetframe_widgets_dir = 'widgets' )
knitr::opts_chunk$set(cache=TRUE) # cache the results for quick compiling knitr
Download and clean all required data
=20
n=data.frame(x=runif(n,-180,180),
datay=runif(n,-60,60),
size = runif(n, 5, 20),
category = factor(
sample(letters[1:5], n, replace = TRUE)
),value = rnorm(n))
%>%
data slice(1:10) %>% #show only 1:n rows
kable(digits=2,align="c")%>% #make table and round to two digits
kable_styling(bootstrap_options =
c("striped", "hover", "condensed", "responsive")) #apply other formatting
x | y | size | category | value |
---|---|---|---|---|
-67.06 | 46.21 | 6.96 | b | 1.62 |
173.44 | 46.95 | 10.07 | c | 0.02 |
-96.70 | 25.97 | 16.61 | e | -0.23 |
134.20 | 32.21 | 15.15 | d | -0.52 |
-130.26 | -54.51 | 11.02 | e | 0.99 |
-69.31 | 24.28 | 19.47 | a | -0.51 |
-63.09 | -10.31 | 12.41 | e | -0.25 |
-102.64 | -4.48 | 8.05 | e | -1.74 |
-25.47 | 56.68 | 8.59 | e | -2.42 |
-124.10 | -14.46 | 8.35 | e | -1.15 |
Add any additional processing steps here.
Results
[~200 words]
Tables and figures (maps and other graphics) are carefully planned to convey the results of your analysis. Intense exploration and evidence of many trials and failures. The author looked at the data in many different ways before coming to the final presentation of the data.
Show tables, plots, etc. and describe them.
<- leaflet(data) %>%
m addTiles() %>%
addCircleMarkers(~x, ~y, radius = ~size,color = ~as.factor(category)) %>%
addPopups(~x[2], ~y[2], "Random popup")
# a map with the default OSM tile layer m
Map of completely random data
%>%
data ggplot(aes(x=x,y=y,col=category))+
geom_point()
Dygraphs Example
library(dygraphs)
dygraph(nhtemp, main = "New Haven Temperatures") |>
dyRangeSelector(dateWindow = c("1920-01-01", "1960-01-01"))
Conclusions
[~200 words]
Clear summary adequately describing the results and putting them in context. Discussion of further questions and ways to continue investigation.
References
All sources are cited in a consistent manner