rstudio / webinars

Code and slides for RStudio webinars
https://resources.rstudio.com/webinars
1.53k stars 1.41k forks source link

Typo in function defintion #36

Open RaymondBalise opened 6 years ago

RaymondBalise commented 6 years ago

In the file 15-RStudio-essentials/1-Writing-Code/sample-script.R the definition of barchart has z listed twice and the function uses z where it should use x. It should be x, z to match the video.

barchart <- function(x, z, width = 0.9) { require(ggplot2)

counts <- table(x) df <- data.frame( value = names(counts), count = as.numeric(counts) )

ggplot(df) + geom_bar(aes(x = value, y = count), stat = "identity", width = width) }

carneybill commented 6 years ago

@garrettgman Could you take a look?