Re: [R] with and evaluation

2016-09-08 Thread Jim Lemon
Hi Carl, order vs sort The order function just returns the indices necessary to put the object into the sorted order, while the sort function returns the sorted object. If you want to use the order function: newdf2<-df2[(order(df2[,1]),] Yes, "with" can be a bit challenging. Think of it as: with

Re: [R] with and evaluation

2016-09-08 Thread Bert Gunter
I echo Duncan's plea. But I can easily resolve one question: "What's with "with? It is one function I do not use because I find it incomprehensible. " Consider: ## first, clear the workspace, also known as the Global environment > rm(list=ls()) ## now create a data frame (or list or environme

Re: [R] with and evaluation

2016-09-08 Thread Jeff Newmiller
You don't say where any of this code you are looking at came from, but I suspect [1]. If you feel the author of that site is failing to explain their answers sufficiently, please communicate that to them, not us. I agree that the documentation file for with() is rather opaque to a beginner and

Re: [R] with and evaluation

2016-09-08 Thread Duncan Murdoch
On 08/09/2016 6:57 PM, Carl Sutton via R-help wrote: Hi I have doing the R-exercises to improve my R programming capabilities. Data.frame exercise 4 showed me that I have a language problem. Here's the problem and my "solution". # Exercise 4# Create a simple data frame from 3 vectors. Orde

[R] with and evaluation

2016-09-08 Thread Carl Sutton via R-help
Hi I have doing the R-exercises to improve my R programming capabilities.   Data.frame exercise 4 showed me that I have  a language problem.  Here's the problem and my "solution". #  Exercise 4#  Create a simple data frame from 3 vectors. Order the entire data frame by the#  first column.df2 <- d