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
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
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
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
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
5 matches
Mail list logo