Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions episodes/02-func-R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,14 @@ rescale <- function(v) {

## Functions to Create Graphs

Write a function called `analyze` that takes a filename as an argument and displays the three graphs produced in the [previous lesson][01] (average, min and max inflammation over time).
`analyze("data/inflammation-01.csv")` should produce the graphs already shown, while `analyze("data/inflammation-02.csv")` should produce corresponding graphs for the second data set.
Write a function called `plotme` that takes a filename as an argument and displays the three graphs produced in the [previous lesson][01] (mean, min and max inflammation over time).
`plotme("data/inflammation-01.csv")` should produce the graphs already shown, while `plotme("data/inflammation-02.csv")` should produce corresponding graphs for the second data set.
Be sure to document your function with comments.

::::::::::::::: solution

```r
analyze <- function(filename) {
plotme <- function(filename) {
# Plots the average, min, and max inflammation over time.
# Input is character string of a csv file.
dat <- read.csv(file = filename, header = FALSE)
Expand Down
Loading