>
> Yes,
>
> x[order(order(z)),]
>
> Two uses of order are needed, as shown.
>
Thank you very much, Rich. It's like a magic!
Leon
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r
Dear all,
I have a data frame with several columns, and I have the specified
order of a given column. How can I re-order the rows of my data frame
accroding to this specified order? for example,
x = data.frame( num = 1:26, alpha = letters[1:26], stringsAsFactors=FALSE)
z = sample(x$alpha, re
Dear R users,
For a uni-variable distribution represented in a numerical vector,
we can obtain a distribution function using 'ecdf', and then calculate
corresponding p-values. But if I have a 2-column dataframe representing
a bi-variable joint distribution, given a pair of values, how can
Patrick Connolly wrote:
On Wed, 12-Aug-2009 at 12:38PM +0800, Leon Yee wrote:
Hi, all
I have a question of adjusting the output of a data frame with many
columns. By default, print() will print out several columns according to
the window size, and then it scrolls down and print out
Hi,
this could be a simple question but I am looking into modifying a data frame
using a "condition" without the need to loop over that data, would that be
possible?
I have tried the following
x<-c(4,5,6,6,8)
y<-c("a","b","b","b","c")
data<-data.frame(x,y)
data
x y
1 4 a
2 5 b
3 6 b
4 6 b
Hi, all
I have a question of adjusting the output of a data frame with many
columns. By default, print() will print out several columns according to
the window size, and then it scrolls down and print out left columns.
How can I make it print all the columns in the same line?
I found o
Oh, sorry, my own fault. I had set a HOME evironmental variable,
and there was a .Rprofile in it, and the setting of .Library.site was
overriden there.
Regards,
Leon
Leon Yee wrote:
> Dear R users,
>
> I am trying to customize the .Library.site in the file
> etc/Rprofil
Dear R users,
I am trying to customize the .Library.site in the file
etc/Rprofile.site under Windows XP, but it seems that the setting
doesn't take effect. My setting is:
.Library.site <- "d:/site-library"
But after I lauched R 2.9.0, the value is always
"d:/PROGRA~1/R/R-29~1.0/site
Hi,
Hans W. Borchers wrote:
Dear all,
Which data structure in R can mimic hash in PERL? I'd like to set
up a lookup table, which could be accomplished by HASH if using PERL.
Which of the data structures in R is the most efficient for lookup
table?
Thanks for your help.
The regular answer t
Dear all,
Which data structure in R can mimic hash in PERL? I'd like to set up
a lookup table, which could be accomplished by HASH if using PERL. Which
of the data structures in R is the most efficient for lookup table?
Thanks for your help.
Best regards,
Leon
___
Vincent Goulet wrote:
It seems that R2.8.0 for gutsy is built on a system with tcl8.5 and
tk8.5, which is not available in gutsy?
From the CRAN Ubuntu README:
>>>
Installation and compilation of R or some its packages may require
Ubuntu packages from the "backports" repositories. In parti
Dirk Eddelbuettel wrote:
On 9 November 2008 at 20:35, Alan Jackson wrote:
| There must be a simple answer to this.
|
| I'm running ubuntu gutsy, currently have 2.7.2 loaded, but the update
| tools refuse to update it, and don't tell me why. With apt-get I get :
|
| [668 ~]$ sudo apt-get -u -V
Peter Dalgaard wrote:
Heinz Tuechler wrote:
At 13:26 09.11.2008, Leon Yee wrote:
Hi, friends
Is there any functions for object comparing? For example, I have two
list objects, and I want to know whether they are the same. Since the
the components of list are not necessary atomic, this kind
Hi, friends
Is there any functions for object comparing? For example, I have two
list objects, and I want to know whether they are the same. Since the
the components of list are not necessary atomic, this kind of comparison
should be recursive. Does this kind of function exist?
Thank you for
Erik Iverson wrote:
## BEGIN R CODE
## guarantees there is at least one level with exactly three elements,
## which your problem seems to require
t1 <- data.frame(a = rnorm(10), b = c("D", "D", "D",
sample(LETTERS[1:3], 7, replace = TRUE)))
## find which names have exactly three elements
t2 <-
Gustaf Rydevik wrote:
Hi Leon,
unique(x)
or
duplicated(x)
should work, depending on what you want.
Best,
Gustaf
Hi,
Thank you all. Actually, I have a data frame or matrix, whose first
column is numerical values, and whose 2nd column is names. I need those
whose names repeated 3 tim
Dear all,
How can I get the duplicated elements from a vector? For example,
x <- c("yes", "no", "yes", "yes", "no", "not sure"), how can I filter
out all the elements which occured >=2 times?
Thanks for any help!
Regards,
Leon
__
R-help@r-p
you do, otherwise ugly surprizes await.
vQ
Leon Yee wrote:
Cool! It works!
Thank you very much!
Leon
Yihui Xie wrote:
You need to get() their elements instead of merely using variable names.
Regards,
Yihui
--
Yihui Xie <[EMAIL PROTECTED]>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China
On Fri, Oct 17, 2008 at 6:23 PM, Leon Yee <[EMAIL PROTECTED]> wrote:
Dear all,
I have a question about "union". "union" handles two vectors' element
Dear all,
I have a question about "union". "union" handles two vectors'
elements to get their union, but I have many vectors and I want to get
the union of all of them. So I wrote a loop:
all <-c();
for(var in ls(pattern="xyz"))
# all of the vectors with pattern of "xyz"
{
all <- union
Thank you, Professor Ripley. It is exactly what I need.
Best wishes!
Leon
Prof Brian Ripley wrote:
By reading from a file or connection, as in
foo <- scan("", "", n=1)
c:\tmp\foo
The parser always interprets \ in strings, so you must avoid the parser.
__
Dear all,
I have a string (a file path in windows system) contains several "\"s.
When I copy and paste it into R for assignment to an variable, the "\"s
are always interpreted as escaping characters. How can I keep it intact?
Thanks.
Regards,
Leon
__
Hello, Kevin
You can get some hints by browsing in this mailist with the subject
of " Upgrading R means I lose my packages", which were posted several
days ago.
HTH
Leon
[EMAIL PROTECTED] wrote:
More and more I am getting warnings from packages that I install that the package was
buil
In my situation under windows xp, after I setting the environment
variable R_LIBS, neither Rgui.exe nor Rterm.exe under cmd.exe doesn't
know the existence of R_LIBS.
After I enter the R interface, I find .libPaths() can add a new location
for installed packages:
> .libPaths("d:/progra~1/R/R
24 matches
Mail list logo