Re: [R] "With" question

2013-09-18 Thread peter dalgaard
On Sep 18, 2013, at 00:22 , Jeff Newmiller wrote: > You seem to be applying the syntax for the within function to the with > function. You should compare the documentation for them and choose your > approach accordingly. The syntax is fine, the difference in within() is that you can do assignm

[R] "With" question

2013-09-17 Thread David Arnold
All, Trying to avoid using attach and detach while teaching class in Intro Stats. data=read.delim("dataset1.dat",header=TRUE) with(data,{ sort(age) length(age) (age[10]+age[11])/2 }) However, this code only produces output for the last line between the curly braces. Granted, as we type the

Re: [R] "With" question

2013-09-17 Thread Jeff Newmiller
You seem to be applying the syntax for the within function to the with function. You should compare the documentation for them and choose your approach accordingly. Also once inside a code block of any type, simply typing a variable name no longer prints it, so you need to use the appropriate fu