Re: [R] Conditional recoding for purpose of imputing

2014-02-09 Thread Bert Gunter
... Well, the syntax is corrected, but it doesn't solve her problem: ifelse() leaves NA's as NA's. "But:, you ask, "what should NA's become?" As the OP does not tell us, we are left to read tea leaves: only the Shadow knows...* Cheers, Bert * The Shadow also knows about ?is.na, which the OP sh

Re: [R] Conditional recoding for purpose of imputing

2014-02-09 Thread Pascal Oettli
Hello Ana, The syntax is: y <- ifelse(x==1, 'YES', 'NO') Hope this helps, Pascal On 10 February 2014 13:03, Ana Genkova wrote: > Hello, > > I am trying the ifelse command for imputing a variable based on a > conditional statement, but the NAs do not transform. The code I am trying > is: > > if

Re: [R] Conditional recoding for purpose of imputing

2014-02-09 Thread David Winsemius
On Feb 9, 2014, at 8:03 PM, Ana Genkova wrote: > Hello, > > I am trying the ifelse command for imputing a variable based on a > conditional statement, but the NAs do not transform. The code I am trying > is: > > ifelse (x==1, y=="NO", y=="YES"). However, the number of NAs remains the > same a

Re: [R] Conditional recoding for purpose of imputing

2014-02-09 Thread Jim Lemon
On 02/10/2014 03:03 PM, Ana Genkova wrote: Hello, I am trying the ifelse command for imputing a variable based on a conditional statement, but the NAs do not transform. The code I am trying is: ifelse (x==1, y=="NO", y=="YES"). However, the number of NAs remains the same after the attempt.

[R] Conditional recoding for purpose of imputing

2014-02-09 Thread Ana Genkova
Hello, I am trying the ifelse command for imputing a variable based on a conditional statement, but the NAs do not transform. The code I am trying is: ifelse (x==1, y=="NO", y=="YES"). However, the number of NAs remains the same after the attempt. I would like to turn all Y (NAs included) int

Re: [R] Help

2014-02-09 Thread arun
Based on the data. vec1 <- c(56,98,15) vec2 <- sort(vec1,decreasing=TRUE)  vec2[1]-vec2[2] #[1] 42 A.K. Hi, I need some help in a simple thing If I have 3 classes like    56     98    15, I need do max1-max2 where the max 1 is the maximun (98) and the max2 is the second maximun (56)...

Re: [R] Text Input from a Non Delimited File

2014-02-09 Thread David Winsemius
On Feb 9, 2014, at 2:48 PM, Burhan ul haq wrote: > Hi, > > I am trying to read in a file, which is not delimited by any specific > characters. > > Something as follows: > ## --- Lines <- readLines(textConnection("GunPos RaceNo Nam

Re: [R] Text Input from a Non Delimited File

2014-02-09 Thread Duncan Murdoch
On 14-02-09 5:56 PM, Burhan ul haq wrote: Hi, Minor Additions: The original file was as follows: ## --- GunPos RaceNo Name Gender Cat Club GunTime ChipPos ChipTime 1 10038 Carl Allwood M Sutton & Ashfield Harriers 02:38:40 1 02:38

Re: [R] Text Input from a Non Delimited File

2014-02-09 Thread Burhan ul haq
Hi, Minor Additions: The original file was as follows: ## --- GunPos RaceNo Name Gender Cat Club GunTime ChipPos ChipTime 1 10038 Carl Allwood M Sutton & Ashfield Harriers 02:38:40 1 02:38:40 2 10098 Adam Holland M Votwo/USN 02:41:2

[R] Regression of complex-valued functions

2014-02-09 Thread Andrea Graziani
Hi everyone, I previously posted this question but my message was not well written and did not contain any code so I will try to do a better job this time. The goal is to perform a non-linear regression on complex-valued data. I will first give a short description of the data and then describe t

[R] Geomorph package: gpagen coordinates in tangent space?

2014-02-09 Thread Alejo C.S.
Hi all, first thanks for a so useful package! I have a question about "gpagen". I understand that the resulting coordinates of this command are in shape space, so for statistical analisys one must project them to tangent space. But the command "plotTangetSpace" runs "prcomp" directly over gpagen's

Re: [R] Two x axes - top and bottom

2014-02-09 Thread David Winsemius
On Feb 8, 2014, at 2:57 PM, Benjamin Ward (ENV) wrote: > Hi, fellow R users, > > I've been asked to make a plot with two datasets each with a different x > axis, and it's been suggested one be at the top and the other at the bottom > of the graph. I normally use ggplot2, and I know how to plot

[R] meaning of lubridate setdiff

2014-02-09 Thread Dan Murphy
In the lubridate vignette (http://cran.r-project.org/web/packages/lubridate/vignettes/lubridate.html) setdiff(auckland, jsm) results in ## [1] 2011-06-04 12:00:00 NZST--2011-07-20 NZST But if Hadley's mentor had been called away earlier, say, July 31st, wouldn't the set difference have resulted

Re: [R] running Rstudio on public server using putty

2014-02-09 Thread Qiang Kou
I don't know why want to use Rstudio on the server, not the R itself. If you use putty and do not need a GUI, I think R is enough. If you really want to use Rstudio on your server, you can try Rstudio server http://www.rstudio.com/ide/server/ On Sat, Feb 8, 2014 at 3:56 PM, Qike Li wrote: > H

[R] ggplot2 counts versus percentages

2014-02-09 Thread Simon Kiss
Hello: I’m having troubles with plotting a barchart with percentages rather than counts in ggplot2. I’m aware that others have a problem with this, but cannot get this to work as I wish. At the end, I’d like a facetted barchart with percentages rather than with counts. Thank you for any assist

Re: [R] Help required for using the prettyTree() to plot a regression tree graphically.......!!!!!!

2014-02-09 Thread Prof Brian Ripley
On 09/02/2014 15:52, Ista Zahn wrote: On Sun, Feb 9, 2014 at 7:20 AM, Prof Brian Ripley wrote: You seem to be under the impression that prettyTree() is something to do with package rpart: it is not. You need to ask the person who told you about prettyTree() where to find it. OR: install.pac

Re: [R] Help required for using the prettyTree() to plot a regression tree graphically.......!!!!!!

2014-02-09 Thread Ista Zahn
On Sun, Feb 9, 2014 at 7:20 AM, Prof Brian Ripley wrote: > You seem to be under the impression that prettyTree() is something to do > with package rpart: it is not. > > You need to ask the person who told you about prettyTree() where to find it. OR: install.packages("sos") library(sos) findFn("p

Re: [R] How to get function arguments as list?

2014-02-09 Thread Robert Latest
On Sun, 09 Feb 2014 12:28:11 + Rui Barradas wrote: > Hello, > > Inside the function try > > dots <- list(...) Hi guys, thanks a lot. I knew it HAD to be something ultra-simple, like most things in R. Regards, robert __ R-help@r-project.org mai

Re: [R] How to get function arguments as list?

2014-02-09 Thread Prof Brian Ripley
On 09/02/2014 12:14, Robert Latest wrote: Hello all, To set options in a package I'm putting together I'd like to write a function like options, that is: my.options <- function(...) { # ... } Now I'd like to access the named arguments that were passed to my funtion within that function. How do

Re: [R] How to get function arguments as list?

2014-02-09 Thread Rui Barradas
Hello, Inside the function try dots <- list(...) Hope this helps, Rui Barradas Em 09-02-2014 12:14, Robert Latest escreveu: Hello all, To set options in a package I'm putting together I'd like to write a function like options, that is: my.options <- function(...) { # ... } Now I'd like t

Re: [R] Help required for using the prettyTree() to plot a regression tree graphically.......!!!!!!

2014-02-09 Thread Prof Brian Ripley
You seem to be under the impression that prettyTree() is something to do with package rpart: it is not. You need to ask the person who told you about prettyTree() where to find it. On 09/02/2014 07:49, Nasim Hasan wrote: Dear All, I am Nasim Hasan a CS Student of New Mexico Stat

[R] How to get function arguments as list?

2014-02-09 Thread Robert Latest
Hello all, To set options in a package I'm putting together I'd like to write a function like options, that is: my.options <- function(...) { # ... } Now I'd like to access the named arguments that were passed to my funtion within that function. How does that work? formals() doesn't do it, neith

[R] Help required for using the prettyTree() to plot a regression tree graphically.......!!!!!!

2014-02-09 Thread Nasim Hasan
Dear All, I am Nasim Hasan a CS Student of New Mexico State University(NMSU). I am using R for my course work on the topics of Big-Data. My OS is Windows Seven and I using R's windows version of 3.0.2 along with the R-Studio of version 0.98.495. The problem is that,

Re: [R] subset of data frame

2014-02-09 Thread arun
Hi, Try: x[x$Species%in%names(sp)[1:2],] A.K. On Saturday, February 8, 2014 10:21 PM, Yuanzhi Li wrote: Hi, everyone I met a small problem when I want take a subset from a data frame. The data frame(x) looks like the followings(10 species with 3 measured traits): Species    trait1    tra

Re: [R] Trouble with pmvnorm?

2014-02-09 Thread Paul Parsons
Many thanks, Peter. Creating a wrapper function for integrand using Vectorize, and then integrating the wrapper, does indeed solve the problem. I tried your final suggestion, but the variable x still gets passed into pmvnorm inside the new mean and variance matrix, leading to the same prob

Re: [R] subset of data frame

2014-02-09 Thread Rui Barradas
Hello, First of all use ?dput to post a data example. dput(head(x, 20)) # paste the output of this in a post Now, without a reproducible example it's difficult to say but maybe ?%in% x[x$Species %in% names(sp)[1:2],] Hope this helps, Rui Barradas Em 09-02-2014 00:03, Yuanzhi Li escreveu: