Permalink
Browse files

Merge pull request #2 from Motokiy/patch-1

change "mean <- mean(data)" to "mean <- colMeans(data)".

checked and merged this pull request. Thank you, Motokiy. 
"mean(<data.frame>)" method is removed from current R version.
  • Loading branch information...
2 parents 41f21d9 + 5801268 commit 806b892720de5fd66910214633769c9da4d2cec4 @setoyama60jp committed Dec 9, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 Chapter4/example4-8.r
View
@@ -2,7 +2,7 @@ library(ggplot2)
pdf("figure4-5.pdf")
data <- read.table("simulation2.csv", header = TRUE, sep = ",")
-mean <- mean(data)
+mean <- colMeans(data)
median <- apply(data, 2, median)
max <- apply(data, 2, max)
df <- data.frame(facilities = seq(from = 1, to = 30), mean = mean, median = median, max = max)
@@ -17,4 +17,4 @@ ggplot(data = df) + scale_shape_manual(name = "Type", values=c(2,3,4)) +
scale_y_continuous("queue size") +
scale_x_continuous("number of facilities in a restroom")
-print(df)
+print(df)

0 comments on commit 806b892

Please sign in to comment.