Re: [R] Printing contents of a variable

2012-08-03 Thread Ted Harding
On 03-Aug-2012 20:46:56 R. Michael Weylandt wrote: > On Fri, Aug 3, 2012 at 3:39 PM, darnold wrote: >> All, >> >> Can someone explain why this does not print the contents of x when I source >> this file? >> >> CoinTosses <- function(n,print=TRUE) { >> x <- sample(c(0,1), n, replace=TRUE) >> y

Re: [R] Printing contents of a variable

2012-08-03 Thread William Dunlap
p-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of R. Michael Weylandt > Sent: Friday, August 03, 2012 1:47 PM > To: darnold > Cc: r-help@r-project.org > Subject: Re: [R] Printing contents of a variable > > On Fri, Aug 3, 2012 at 3

Re: [R] Printing contents of a variable

2012-08-03 Thread R. Michael Weylandt
On Fri, Aug 3, 2012 at 3:39 PM, darnold wrote: > All, > > Can someone explain why this does not print the contents of x when I source > this file? > > CoinTosses <- function(n,print=TRUE) { > x <- sample(c(0,1), n, replace=TRUE) > y <- x > y[y==0] <- "T" > y[y==1] <- "H" > p <- sum(x)/n

[R] Printing contents of a variable

2012-08-03 Thread darnold
All, Can someone explain why this does not print the contents of x when I source this file? CoinTosses <- function(n,print=TRUE) { x <- sample(c(0,1), n, replace=TRUE) y <- x y[y==0] <- "T" y[y==1] <- "H" p <- sum(x)/n p } x <- CoinTosses(40) x On the other hand, if I source this fi