[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 file:

Re: [R] Printing contents of a variable

2012-08-03 Thread R. Michael Weylandt
On Fri, Aug 3, 2012 at 3:39 PM, darnold dwarnol...@suddenlink.net 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 -

Re: [R] Printing contents of a variable

2012-08-03 Thread William Dunlap
PM To: darnold Cc: r-help@r-project.org Subject: Re: [R] Printing contents of a variable On Fri, Aug 3, 2012 at 3:39 PM, darnold dwarnol...@suddenlink.net wrote: All, Can someone explain why this does not print the contents of x when I source this file? CoinTosses - function(n

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 dwarnol...@suddenlink.net 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,