[R] R CMD check Package(Windows): Error in inDL(x, as.logical(local), as.logical(now), ...) :

2010-09-01 Thread raje...@cse.iitm.ac.in
Hi, I've built my own package in windows and when I run R CMD check Package-Name I get, * install options are ' --no-html' * installing *source* package 'AceTest' ... ** libs making DLL ... g++ ...etc. installing to ... done ** R ** preparing package for lazy loading ** help Warning: ./ma

[R] extract month data automatically

2010-09-01 Thread Roslina Zakaria
Hi, I would like to extract monthly data automatically using a code.  Given are my sample data. I know how to do one by one: jan_data1 <- Pooraka_data[Pooraka_data$Month=="1",4] feb_data1 <- Pooraka_data[Pooraka_data$Month=="2",4] mar_data1 <- Pooraka_data[Pooraka_data$Month=="3",4] apr_data1 <

[R] How to generate integers from uniform distribution with fixed mean

2010-09-01 Thread Yi
Hi, folks, runif (n,min,max) is the typical code for generate R.V from uniform dist. But what if we need to fix the mean as 20, and we want the values to be integers only? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org ma

Re: [R] How to access some elements of a S4 object?

2010-09-01 Thread Xiang Li
David, Thanks a lot!!! It works,and that's what I need. Good night. Sean From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Wed 9/1/2010 9:50 PM To: Xiang Li Cc: r-help@r-project.org Subject: Re: [R] How to access some elements of a S4 object?

Re: [R] Cross Spectrum Analysis

2010-09-01 Thread David Winsemius
On Sep 2, 2010, at 1:00 AM, aftar wrote: Hi Is anyone know how could I find the cross spectrum? from the spectrum function, it only give the spectrum for each individual series. I read the manual very differently. It is telling me that you _do_ get cross spectrum results in the "coh"

Re: [R] [semi-OT] Using fortune() in an email signature

2010-09-01 Thread Allan Engelhardt
On 01/09/10 22:18, Dirk Eddelbuettel wrote: [...] Doing the same with Rscript is left as an exercise I like exercises: Rscript --default-packages="fortunes" -e "print(fortune())" Allan __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] Cross Spectrum Analysis

2010-09-01 Thread aftar
Hi Is anyone know how could I find the cross spectrum? from the spectrum function, it only give the spectrum for each individual series. Thanks Aftar -- View this message in context: http://r.789695.n4.nabble.com/Cross-Spectrum-Analysis-tp855188p2473397.html Sent from the R help mailing list

Re: [R] How to access some elements of a S4 object?

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 10:04 PM, Xiang Li wrote: Hi, Could you please tell me how to access the elements of a S4 object? Slot "alpha.name": [1] "Cutoff" p...@alpha.values [[1]] [1] Inf 0.991096434 0.984667270 0.984599159 0.983494405 0.970641299 0.959417835 0.945548941 0.943432189

Re: [R] diamond/triangle "plot"

2010-09-01 Thread John K. Williams
I'll check out those functions, thanks much for the help. On Wed, Sep 1, 2010 at 8:38 PM, Ben Bolker wrote: > David Winsemius comcast.net> writes: > > > > > > > On Sep 1, 2010, at 7:50 PM, John K. Williams wrote: > > > > > Hi, does anyone have any idea how I might make a plot in R similar > > >

Re: [R] diamond/triangle "plot"

2010-09-01 Thread Dennis Murphy
Hi: As a statistician and long time baseball addict, I concur wholeheartedly with David that: ..."you've got to admit that was one gawdawful graph". Firstly, the areas are not proportional to the values; this is a common graphics mistake. (For example, compare baserunning to power - is the area

Re: [R] Writing My Own Function to Use With aggregate

2010-09-01 Thread Dennis Murphy
Hi: aggregate() is not well suited for summarization when the summary function takes multiple input arguments. Better choices for this type of summary are packages plyr, as David mentioned, and data.table. Here's a toy example to illustrate. The fake data contain two grouping variables as factors

[R] How to access some elements of a S4 object?

2010-09-01 Thread Xiang Li
Hi, Could you please tell me how to access the elements of a S4 object? Slot "alpha.name": [1] "Cutoff" > p...@alpha.values [[1]] [1] Inf 0.991096434 0.984667270 0.984599159 0.983494405 0.970641299 0.959417835 0.945548941 0.943432189 [10] 0.938583020 0.932159806 0.9308469

Re: [R] diamond/triangle "plot"

2010-09-01 Thread Ben Bolker
David Winsemius comcast.net> writes: > > > On Sep 1, 2010, at 7:50 PM, John K. Williams wrote: > > > Hi, does anyone have any idea how I might make a plot in R similar > > to this: > > http://assets.sbnation.com/assets/272612/BATTER-1B-PENA.png > > > > Specifically looking to plot 3 numbers

Re: [R] diamond/triangle "plot"

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 7:50 PM, John K. Williams wrote: Hi, does anyone have any idea how I might make a plot in R similar to this: http://assets.sbnation.com/assets/272612/BATTER-1B-PENA.png Specifically looking to plot 3 numbers in a triangle like that. Well, not exactly what you requested

[R] diamond/triangle "plot"

2010-09-01 Thread John K. Williams
Hi, does anyone have any idea how I might make a plot in R similar to this: http://assets.sbnation.com/assets/272612/BATTER-1B-PENA.png Specifically looking to plot 3 numbers in a triangle like that. [[alternative HTML version deleted]] __ R-he

Re: [R] vglm

2010-09-01 Thread Dejian Zhao
I am glad it works. But you should reply to the list, thus more people can trace the process of the question. As to your second question, I have no idea how to solve it. I suggest you start another thread. There will be someone able to answer you in the R mailing list. Remember to reply to the

Re: [R] testing for emptyenv

2010-09-01 Thread Duncan Murdoch
On 01/09/2010 7:03 PM, Vadim Ogranovich wrote: Dear R-users, Is there a way to test whether a particular environment e is equal to emtyenv(), or for that sake whether two environments e1 and e2 are equal? I tried a couple of ways to compare environments, but neither seem to work: e1 <- new.e

Re: [R] [semi-OT] Using fortune() in an email signature

2010-09-01 Thread Stuart Luppescu
On Wed, 2010-09-01 at 16:32 -0500, Christian Raschke wrote: > Simply using option --slave instead seems to do the trick. > > $ /usr/bin/R --slave < test-fortune.R Great! Thanks very much, Christian. Matt Shotwell, I didn't try your solution, since Christian's is so simple, but thanks for writing

[R] testing for emptyenv

2010-09-01 Thread Vadim Ogranovich
Dear R-users, Is there a way to test whether a particular environment e is equal to emtyenv(), or for that sake whether two environments e1 and e2 are equal? I tried a couple of ways to compare environments, but neither seem to work: > e1 <- new.env() > e2 <- new.env() > e1 == e2 Error in e1 ==

Re: [R] Legend with fill = gray ?

2010-09-01 Thread juan xiong
Try this: fill=c("gray"(0.1),"gray"(0.5),"gray"(1)) On Wed, Sep 1, 2010 at 4:59 PM, Jens Oldeland wrote: > No...but it works! > > I do not know why I did not find it... > Many thanks! > > > Hi David, thanks to you as well. > > > Greg Snow schrieb: > > Did you try gray.colors(3)? > > > >

Re: [R] ggplot2 multiple group barchart

2010-09-01 Thread Jonathan Christensen
Greg, Try this: library (ggplot2) v1 <- c(1,2,3,3,4) v2 <- c(4,3,1,1,9) v3 <- c(3,5,7,2,9) gender <- c("m","f","m","f","f") d.data <- data.frame (v1, v2, v3, gender) d.data #library(reshape) #library(plyr) # These are already loaded by ggplot2, but for your reference: reshape provides melt

Re: [R] Writing My Own Function to Use With aggregate

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 6:29 PM, Adrian Ng wrote: Dear R-Users, I have been using R for about 1 week and recently learned about the Aggregate function, and from reading online it seems like it is comparable to a SQL group by to perform summary functions. I am looking to do a summary function

[R] Writing My Own Function to Use With aggregate

2010-09-01 Thread Adrian Ng
Dear R-Users, I have been using R for about 1 week and recently learned about the Aggregate function, and from reading online it seems like it is comparable to a SQL group by to perform summary functions. I am looking to do a summary function, such as SUM/MIN, but instead of these basic functi

Re: [R] [semi-OT] Using fortune() in an email signature

2010-09-01 Thread Matt Shotwell
Or using R & GNU tools: m...@max:~$ R -e "fortunes::fortune()" | gawk '/^[^>]/ {print}' It's not a question of trying variations, rather of following instructions. -- Brian D. Ripley (about using 'Writing R Extensions') R-help (January 2006) -Matt On Wed, 2010-09-01 at 16:49 -0400, Stu

Re: [R] [semi-OT] Using fortune() in an email signature

2010-09-01 Thread Christian Raschke
Simply using option --slave instead seems to do the trick. $ /usr/bin/R --slave < test-fortune.R Similarly to Brian, I'm much more reluctant to help people who don't exist -- who knows, maybe you're a computer program who has just passed the Turing test :-) -- Martin Maechler (about postin

Re: [R] [semi-OT] Using fortune() in an email signature

2010-09-01 Thread Dirk Eddelbuettel
On 1 September 2010 at 15:49, Stuart Luppescu wrote: | Hello, As you can see from my signature in this message, I use the R | fortune function to generate a fortune, which is then fed to the | signature program, which constructs a named pipe containing the | fortune-bearing sig, which is then incl

Re: [R] general question on binomial test / sign test

2010-09-01 Thread Greg Snow
Try thinking this one through from first principles, you are essentially saying that your null hypothesis is that you are flipping a fair coin and you want to do a 2-tailed test. You then flip the coin exactly once, what do you expect to happen? The p-value of 1 just means that what you saw wa

[R] general question on binomial test / sign test

2010-09-01 Thread Kay Cichini
hello, i did several binomial tests and noticed for one sparse dataset that binom.test(1,1,0.5) gives a p-value of 1 for the null, what i can't quite grasp. that would say that the a prob of 1/2 has p-value of 0 ?? - i must be wrong but can't figure out the right interpretation.. best, kay

Re: [R] Legend with fill = gray ?

2010-09-01 Thread Jens Oldeland
No...but it works! I do not know why I did not find it... Many thanks! Hi David, thanks to you as well. Greg Snow schrieb: > Did you try gray.colors(3)? > __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] Legend with fill = gray ?

2010-09-01 Thread Greg Snow
Did you try gray.colors(3)? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: Jens Oldeland [mailto:oldel...@gmx.de] > Sent: Wednesday, September 01, 2010 2:43 PM > To: Greg Snow > Cc: r-help@r-

Re: [R] [semi-OT] Using fortune() in an email signature

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 4:49 PM, Stuart Luppescu wrote: Hello, As you can see from my signature in this message, I use the R fortune function to generate a fortune, which is then fed to the signature program, which constructs a named pipe containing the fortune-bearing sig, which is then included in

[R] [semi-OT] Using fortune() in an email signature

2010-09-01 Thread Stuart Luppescu
Hello, As you can see from my signature in this message, I use the R fortune function to generate a fortune, which is then fed to the signature program, which constructs a named pipe containing the fortune-bearing sig, which is then included in mail messages. The problem is that it's got extraneous

Re: [R] Legend with fill = gray ?

2010-09-01 Thread Jens Oldeland
Hi, sorry for beeing unprecise. I am looking for a legend that has the same colors as the barplot. For a coloured version I would simply use the same fill=rainbow() option as used in creating the barplot. However, this does not work when there are gray values, because there are not defined in the

Re: [R] lattice: plot alignment fails

2010-09-01 Thread Marius Hofert
Okay, I solved it. After using the same arguments for "scales" (in particular: relation="free"), the plots are perfectly aligned. Cheers, Marius On 2010-08-24, at 20:39 , Marius Hofert wrote: > Dear expeRts, > > I would like to have four plots appearing in one figure. The minimal example > s

Re: [R] Legend with fill = gray ?

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 4:17 PM, Jens Oldeland wrote: Hi, I am facing a problem with the legend, I don´t know how to use the fill option in the legend in order to achieve the same standard gray levels that are plotted. Sorry for this easy one, but I really did not find anything so far. It work

Re: [R] Legend with fill = gray ?

2010-09-01 Thread Greg Snow
The phrase "does not work" can mean many things, it would help us to help you if you spelled out what you expected and how what you saw differs from what was expected. I suspect part of your problem may be in using 0.1:0.3, did you try typing just that at the command line to see the result? Th

[R] Legend with fill = gray ?

2010-09-01 Thread Jens Oldeland
Hi, I am facing a problem with the legend, I don´t know how to use the fill option in the legend in order to achieve the same standard gray levels that are plotted. Sorry for this easy one, but I really did not find anything so far. It works fine with color: ## C O L O R mat <- matrix(2,3,r

[R] CRAN Mirror definition error.

2010-09-01 Thread Lenart, Joseph
Hello, I was wondering if anyone has run across this problem in the past and might be able to suggest a solution. I did a review of the FAQ's link trying to find a topic that closely related to the experience I was having, however I didn't see anything that might help in diagnosing the problem.

Re: [R] xyplot (Lattice): Group order in display

2010-09-01 Thread jrflanders
Thank you! It is always so simple... May I throw another question at you? In useOuterStrips, in the latticeExtra package, I am having problems calling custom strip names, e.g. useOuterStrips(xyplot(y-x | LOCATION + EVENT, data = TC6, groups = TYPE), strip=strip.custom(factor. levels = c("Left",

Re: [R] xyplot (Lattice): Group order in display

2010-09-01 Thread Deepayan Sarkar
On Wed, Sep 1, 2010 at 9:00 AM, jrflanders wrote: > > Dear R users, > > I would like one of my groups in xyplot to appear to lie 'behind' the other > groups. I have searched for help and find many, many topics about panel > order (e.g., "as.table"), but that is not what I need. > > What is odd is

Re: [R] [Q] Goodness-of-fit test of a logistic regression model using rms package

2010-09-01 Thread Bert Gunter
... and, furthermore, in most real world situations there are several -- or even "lots" -- of quite different, incomparable models that give essentially equivalent fits. Distinguishing among the alternatives typically requires focused studies designed for the task. Indeed, as Brian Joiner remarked

Re: [R] how to represent error bar in a plot legend?

2010-09-01 Thread John Kane
Can you give us a working example of what you are doing? I don't understand why you would need a pch symbol for an error bar. Perhaps if you are using an unboxed legend you could just use arrow() and text() to add the error bar to the legend? --- On Wed, 9/1/10, josef.kar...@phila.gov wrote:

Re: [R] [Q] Goodness-of-fit test of a logistic regression model using rms package

2010-09-01 Thread Frank Harrell
On Wed, 1 Sep 2010, GMail (KU) wrote: Hello, I was looking for a way to evaluate the goodness-of-fit of a logistic regression model. After googling, I found that I could use "resid(fit, 'gof')" method implemented in the rms package. However, since I am not used to the "le Cessie-van Houwel

Re: [R] problems with unique

2010-09-01 Thread Ben Bolker
n.vialma libero.it libero.it> writes: > > Hi everyone, > I have a question concerning the unique function. I'm using it with two > different data frame,which are similar in structure, but as in one case > unique > works properly in the other doesn't work and I don't understand why. > Someone

[R] how to represent error bar in a plot legend?

2010-09-01 Thread Josef . Kardos
I have a simple barplot of 4 mean values, each mean value has an associated 95% confidence interval drawn on the plot as an error bar. I want to make a legend on the plot that uses the error bar symbol, and explains "95% C.I." How do I show the error bar symbol in the legend? I could not find

[R] problems with unique

2010-09-01 Thread n.via...@libero.it
Hi everyone, I have a question concerning the unique function. I'm using it with two different data frame,which are similar in structure, but as in one case unique works properly in the other doesn't work and I don't understand why. Someone knows why sometimes unique doesn't do things properly??

Re: [R] standardize columns selectively within a dataframe

2010-09-01 Thread Olga Lyashevska
On Wed, 2010-09-01 at 12:42 -0400, David Winsemius wrote: > I suspect you might have tried (df-mean(df))/sd(x) and gotten > unsatisfactory results; I know I did. yes, indeed! a few times, but why is that? > If you had really wanted to > persist and do it from first principles, so to speak,

Re: [R] standardize columns selectively within a dataframe

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 10:42 AM, David Winsemius wrote: On Sep 1, 2010, at 10:35 AM, Olga Lyashevska wrote: Dear all, I have a dataframe: df<-dataframe(a=c(1,2,3),b=c(4,5,6),c=c(7,8,9),d=c(10,11,12)) I want to obtain a new dataframe with columns a and b being standardized ((x-mean(x))/sd(x)

[R] [Q] Goodness-of-fit test of a logistic regression model using rms package

2010-09-01 Thread GMail (KU)
Hello, I was looking for a way to evaluate the goodness-of-fit of a logistic regression model. After googling, I found that I could use "resid(fit, 'gof')" method implemented in the rms package. However, since I am not used to the "le Cessie-van Houwelingen normal test statistic," I do not know

[R] ggplot2 case study competiton and wiki

2010-09-01 Thread Garrett Grolemund
Hi all, We've moved the ggplot2 wiki to a new location to make it more useful, http://github.com/hadley/ggplot2/wiki. To publicize the new location, we’re organizing a second ggplot2 case study competition. Some great prizes are at stake: * grand prize will be a 32GB ipod touch generously donate

Re: [R] Why is vector assignment in R recreates the entire vector ?

2010-09-01 Thread Duncan Murdoch
On 01/09/2010 11:09 AM, Tal Galili wrote: Hello all, A friend recently brought to my attention that vector assignment actually recreates the entire vector on which the assignment is performed. So for example, the code: x[10]<- NA # The original call (short version) Is really doing this: x<- re

[R] xyplot (Lattice): Group order in display

2010-09-01 Thread jrflanders
Dear R users, I would like one of my groups in xyplot to appear to lie 'behind' the other groups. I have searched for help and find many, many topics about panel order (e.g., "as.table"), but that is not what I need. What is odd is that the group that I want to appear 'behind' the others (PROFI

[R] ggplot2 multiple group barchart

2010-09-01 Thread Waller Gregor (wall)
hi there.. i got a problem with ggplot2. here my example: library (ggplot2) v1 <- c(1,2,3,3,4) v2 <- c(4,3,1,1,9) v3 <- c(3,5,7,2,9) gender <- c("m","f","m","f","f") d.data <- data.frame (v1, v2, v3, gender) d.data x <- names (d.data[1:3]) y <- mean (d.data[1:3]) pl <- ggplot (data=

Re: [R] documentation to upgrade R-package from 32 to 64bit

2010-09-01 Thread Duncan Murdoch
On 01/09/2010 7:40 AM, Hayes, Daniel wrote: Dear all, I am working with the an R-package named GAMLSS (www.gamlss.com) it is currently only functional under the 32-bit version of R (for windows) The author of the package has agreed to help me create 64-bit compatible ve

Re: [R] non-linear plot parameters

2010-09-01 Thread Marlin Keith Cox
> > This is one data set. I have used linear models, but as these data reflect > fish consuming energy during a starvation period, there is a lower > asymptote. I also realize that data is rather scattered and not the > cleanest. I am interested in looking at how fast the animals reach the > asy

[R] how to replace NA with a specific score that is dependant on another indicator variable

2010-09-01 Thread Chris Howden
Hi everyone, I’m looking for a clever bit of code to replace NA’s with a specific score depending on an indicator variable. I can see how to do it using lots of if statements but I’m sure there most be a neater, better way of doing it. Any ideas at all will be much appreciated, I’m dreadin

Re: [R] documentation to upgrade R-package from 32 to 64bit

2010-09-01 Thread Matt Shotwell
Try this: http://www.stats.ox.ac.uk/~ripley/Win64/W64porting.html -Matt On Wed, 2010-09-01 at 07:40 -0400, Hayes, Daniel wrote: > Dear all, > > I am working with the an R-package named GAMLSS > (www.gamlss.com) it is currently only functional under > the 32-bit version o

Re: [R] How to specify only minimum ylim parameter for boxplot

2010-09-01 Thread mamunbabu2001
Hi, I recently have a similar problem. since your post is about 4 months old I assume you have already got the answer. Try boxplot (data, ylim = c(min_lim, max_lim)) -- View this message in context: http://r.789695.n4.nabble.com/How-to-specify-only-minimum-ylim-parameter-for-boxplot-tp17541

[R] [R-pkgs] New package: lubridate 0.1

2010-09-01 Thread Garrett Grolemund
Please find below the package announcement for the R package lubridate available from cran. Thank you, Garrett Grolemund Rice University ##lubridate Date-time data can be frustrating to work with in R. R commands for date-times are generally unintuitive and change depending on the type of date-

[R] [R-pkgs] testthat: version 0.3

2010-09-01 Thread Hadley Wickham
# testthat Testing your code is normally painful and boring. `testthat` tries to make testing as fun as possible, so that you get a visceral satisfaction from writing tests. Testing should be fun, not a drag, so you do it all the time. To make that happen, `testthat`: * Provides functions that ma

[R] documentation to upgrade R-package from 32 to 64bit

2010-09-01 Thread Hayes, Daniel
Dear all, I am working with the an R-package named GAMLSS (www.gamlss.com) it is currently only functional under the 32-bit version of R (for windows) The author of the package has agreed to help me create 64-bit compatible version. I've been looking through the available

Re: [R] Why is vector assignment in R recreates the entire vector ?

2010-09-01 Thread Matt Shotwell
Tal, For your first example, x is not duplicated in memory. If you compile R with --enable-memory-profiling, you have access to the tracemem() function, which will report whether x is duplicate()d: > x <- rep(1,100) > tracemem(x) [1] "<0x8f71c38>" > x[10] <- NA This does not result in duplicati

Re: [R] Using packages built in linux in windows

2010-09-01 Thread Ben Bolker
rajesh j gmail.com> writes: > I thought building a binary took care of that issue. How do I port a linux > library to windows? I think we need a little clarification here. When you say "a linux library", do you mean a chunk of compiled (non-R) code that the R package (sic) needs to use in or

Re: [R] Using packages built in linux in windows

2010-09-01 Thread rajesh j
Unfortunately, the library is built with visual studio in windows. It doesnt work with MinGW. On Wed, Sep 1, 2010 at 9:35 PM, Jeff Newmiller wrote: > Normally, a binary package built on one platform will not work on another. > While it is possible to cross-compile, in most cases it is best to ass

Re: [R] Using packages built in linux in windows

2010-09-01 Thread Jeff Newmiller
Normally, a binary package built on one platform will not work on another. While it is possible to cross-compile, in most cases it is best to assemble the necessary development environment oNoten the target platform (including the appropriate libraries compiled for that platform) and build the p

Re: [R] Why is vector assignment in R recreates the entire vector ?

2010-09-01 Thread Tal Galili
Thank you for the explanation Duncan - very interesting indeed! I wonder if someone in the list might know to answer your question regarding the double duplication. Best, Tal Contact Details:--- Contact me: tal.gal...@gmail.com

Re: [R] Using packages built in linux in windows

2010-09-01 Thread Duncan Murdoch
On 01/09/2010 11:51 AM, rajesh j wrote: I thought building a binary took care of that issue. How do I port a linux library to windows? Building a binary package links the package to the library, but if the library doesn't exist, there's nothing to link to. Porting a Linux library to Windo

[R] xyplot (Lattice): Group order in display

2010-09-01 Thread jrflanders
Dear R users, I would like one of my groups in xyplot to appear to lie 'behind' the other groups. I have searched for help and find many, many topics about panel order (e.g., "as.table"), but that is not what I need. What is odd is that the group that I want to appear 'behind' the others (PROFIL

Re: [R] how to replace NA with a specific score that is dependant on another indicator variable

2010-09-01 Thread Hadley Wickham
> first ddply result did I see that some sort of misregistration had occurred; > Better with: > > res <-ddply(egraw2, .(category), .fun=function(df) { >               sapply(df, >                    function(x) {mnx <- mean(x, na.rm=TRUE); >                                 sapply(x, function(z) if

Re: [R] getting column names of row-by-row sorted matrix

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 11:34 AM, David Winsemius wrote: snipped > t( apply(a, 1, function(x) colnames(a)[order(x)]) ) [,1] [,2] [,3] [,4] [1,] "A" "C" "B" "D" [2,] "A" "C" "B" "D" [3,] "D" "B" "C" "A" [4,] "B" "A" "C" "D" [5,] "C" "D" "B" "A" (apply returns a transposed version

Re: [R] Using packages built in linux in windows

2010-09-01 Thread rajesh j
I thought building a binary took care of that issue. How do I port a linux library to windows? On Wed, Sep 1, 2010 at 9:12 PM, Duncan Murdoch wrote: > On 01/09/2010 11:34 AM, rajesh j wrote: > >> This problem doesnt seem to have anything to do with Rcpp. I can't build >> it >> on windows because

Re: [R] Using packages built in linux in windows

2010-09-01 Thread Duncan Murdoch
On 01/09/2010 11:34 AM, rajesh j wrote: This problem doesnt seem to have anything to do with Rcpp. I can't build it on windows because I'm using a library thats only available in linux. Isnt this a resolvable error? The resolution looks pretty obvious: port the library to Windows. Duncan M

Re: [R] Where can the "benchmark2" function be downloaded from?

2010-09-01 Thread Tal Galili
Thank you David! That's exactly what I was looking for. Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (

Re: [R] Where can the "benchmark2" function be downloaded from?

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 11:13 AM, Tal Galili wrote: Hello all, I am looking for the function benchmark2 ( a nice function for comparing the performance of two or more functions). I found online it exists in the butler package http://crantastic.org/packages/butler Have you looked at package rbe

Re: [R] Why is vector assignment in R recreates the entire vector ?

2010-09-01 Thread Bert Gunter
On Wed, Sep 1, 2010 at 8:09 AM, Tal Galili wrote: > Hello all, > > A friend recently brought to my attention that vector assignment actually > recreates the entire vector on which the assignment is performed. > > So for example, the code: > x[10]<- NA # The original call (short version) > > Is rea

Re: [R] Using packages built in linux in windows

2010-09-01 Thread rajesh j
This problem doesnt seem to have anything to do with Rcpp. I can't build it on windows because I'm using a library thats only available in linux. Isnt this a resolvable error? On Wed, Sep 1, 2010 at 9:07 PM, wrote: > Hi, > > The proper venue for Rcpp related questions is the Rcpp-devel mailing l

Re: [R] getting column names of row-by-row sorted matrix

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 11:18 AM, wrote: Hi folks, I want to sort a matrix row-by-row and create a new matrix that contains the corresponding colnames of the original matrix. E.g. set.seed(123) a <- matrix(rnorm(20), ncol=4); colnames(a) <- c("A","B","C","D") a A B

[R] Where can the "benchmark2" function be downloaded from?

2010-09-01 Thread Tal Galili
Hello all, I am looking for the function benchmark2 ( a nice function for comparing the performance of two or more functions). I found online it exists in the butler package http://crantastic.org/packages/butler But for some reason, that package was removed from CRAN: http://cran.r-project.org/we

Re: [R] Using packages built in linux in windows

2010-09-01 Thread romain
Hi, The proper venue for Rcpp related questions is the Rcpp-devel mailing list: http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel Of course you can build a package that uses Rcpp on windows, once all the proper tools are installed, it is just the same as building it on any

[R] Why is vector assignment in R recreates the entire vector ?

2010-09-01 Thread Tal Galili
Hello all, A friend recently brought to my attention that vector assignment actually recreates the entire vector on which the assignment is performed. So for example, the code: x[10]<- NA # The original call (short version) Is really doing this: x<- replace(x, list=10, values=NA) # The original

[R] getting column names of row-by-row sorted matrix

2010-09-01 Thread Murali.Menon
Hi folks, I want to sort a matrix row-by-row and create a new matrix that contains the corresponding colnames of the original matrix. E.g. > set.seed(123) > a <- matrix(rnorm(20), ncol=4); colnames(a) <- c("A","B","C","D") > a A B C D [1,] -0.56047565

Re: [R] invert order

2010-09-01 Thread Ivan Calandra
Hi, Maybe sort(x, decreasing=TRUE) would do it HTH, Ivan Le 9/1/2010 16:56, Sebastian Kruk a écrit : > Dear R-help list users, > > I have a huge vector of numbers, how I can invert orden? > > For example > > x<- 1:1000 > > I would like to obtain > > x_r<- 1000:1 > > Thanks, > > Sebasti

[R] Using packages built in linux in windows

2010-09-01 Thread rajesh j
Hi, I built a package in linux and would like to use it in windows. I cant build the package again in windows because it would miss the necessary libraries etc(I'm using Rcpp). So I need to generate a binary version and try to install it in windows. I tried this and I get the error /cygdrive/RToo

Re: [R] invert order

2010-09-01 Thread Seeliger . Curt
Sebastian writes: > I have a huge vector of numbers, how I can invert orden? > For example > x <- 1:1000 > I would like to obtain > x_r <- 1000:1 Well, 1000:1 works for me. If you need to rev()erse a pre-existing vector, try rev(). cur -- Curt Seeliger, Data Ranger Raytheon Informa

[R] invert order

2010-09-01 Thread Sebastian Kruk
Dear R-help list users, I have a huge vector of numbers, how I can invert orden? For example x <- 1:1000 I would like to obtain x_r <- 1000:1 Thanks, Sebastian. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] standardize columns selectively within a dataframe

2010-09-01 Thread Olga Lyashevska
Thanks! It is exactly what I was looking for! Cheers Olga __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] standardize columns selectively within a dataframe

2010-09-01 Thread Adaikalavan Ramasamy
If you want to scale within columns, you could try cbind( scale(df[,1:2]), df[ ,-c(1:2)] ) a b c d 1 -1 -1 7 10 2 0 0 8 11 3 1 1 9 12 and it is data.frame() btw. On 01/09/2010 15:35, Olga Lyashevska wrote: Dear all, I have a dataframe: df<-dataframe(a=c(1,2,3),b=c(4,5,6),c=c(7,

Re: [R] standardize columns selectively within a dataframe

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 10:35 AM, Olga Lyashevska wrote: Dear all, I have a dataframe: df<-dataframe(a=c(1,2,3),b=c(4,5,6),c=c(7,8,9),d=c(10,11,12)) I want to obtain a new dataframe with columns a and b being standardized ((x-mean(x))/sd(x)); the other two columns (c,d) I want to leave unchange

[R] standardize columns selectively within a dataframe

2010-09-01 Thread Olga Lyashevska
Dear all, I have a dataframe: df<-dataframe(a=c(1,2,3),b=c(4,5,6),c=c(7,8,9),d=c(10,11,12)) I want to obtain a new dataframe with columns a and b being standardized ((x-mean(x))/sd(x)); the other two columns (c,d) I want to leave unchanged. What is the best way to achieve this? I have been try

Re: [R] Rd-file error: non-ASCII input and no declared encoding

2010-09-01 Thread Christian Hennig
Dear Gavin, very well spotted => solved! Thanks also Duncan! Christian On Wed, 1 Sep 2010, Gavin Simpson wrote: On Wed, 2010-09-01 at 15:09 +0100, Christian Hennig wrote: Dear list, I came across the following error for three of my newly written Rd-files: non-ASCII input and no declared enc

[R] Autocorrelation with merMCMC object

2010-09-01 Thread berthouly cecile
Hello, *I have some issues with furnction that I've used before and that are not working anymore. I want to check the autocorrelation of an object merMCMC but the function autocorr did not acccept merMCMC object.Is there any ither funtion that I could use?* *>mm0.REML<-lmer(TD~1+SEXE+(1|PROVINCE)

Re: [R] how to replace NA with a specific score that is dependant on another indicator variable

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 10:19 AM, David Winsemius wrote: On Sep 1, 2010, at 9:55 AM, David Winsemius wrote: On Sep 1, 2010, at 9:20 AM, Chris Howden wrote: Hi everyone, I’m looking for a clever bit of code to replace NA’s with a specific score depending on an indicator variable. I can s

Re: [R] Rd-file error: non-ASCII input and no declared encoding

2010-09-01 Thread Duncan Murdoch
On 01/09/2010 10:09 AM, Christian Hennig wrote: Dear list, I came across the following error for three of my newly written Rd-files: non-ASCII input and no declared encoding I don't think the problem survived emailing, at least I didn't see it. You can display all the non-ASCII characters

[R] opls-da

2010-09-01 Thread Francesca Chignola
Dear all, I would like to apply Orthogonal Projections to Latent Structures Discriminant Analysis (OPLS-DA) to a metabolomic dataset, in order to discriminate two groups of samples. I have looked for an available R package and I have found "K-OPLS" and oscorespls.fit (Orthogonal scores PLSR) f

Re: [R] Rd-file error: non-ASCII input and no declared encoding

2010-09-01 Thread Gavin Simpson
On Wed, 2010-09-01 at 15:09 +0100, Christian Hennig wrote: > Dear list, > > I came across the following error for three of my newly written Rd-files: > non-ASCII input and no declared encoding I'm not sure, but is it the m- or n-dash character for the page range in the \source{} section? 2317–23

Re: [R] how to replace NA with a specific score that is dependant on another indicator variable

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 9:55 AM, David Winsemius wrote: On Sep 1, 2010, at 9:20 AM, Chris Howden wrote: Hi everyone, I’m looking for a clever bit of code to replace NA’s with a specific score depending on an indicator variable. I can see how to do it using lots of if statements but I’m sur

[R] Rd-file error: non-ASCII input and no declared encoding

2010-09-01 Thread Christian Hennig
Dear list, I came across the following error for three of my newly written Rd-files: non-ASCII input and no declared encoding I can't make sense of this. Below I copied in one of the three files. Can anybody please tell me what's wrong with it? Thank you, Christian \name{tetragonula} \alias{t

Re: [R] how to replace NA with a specific score that is dependant on another indicator variable

2010-09-01 Thread David Winsemius
On Sep 1, 2010, at 9:20 AM, Chris Howden wrote: Hi everyone, I’m looking for a clever bit of code to replace NA’s with a specific score depending on an indicator variable. I can see how to do it using lots of if statements but I’m sure there most be a neater, better way of doing it.

Re: [R] Remove "Loading required package" message

2010-09-01 Thread Dieter Menne
Sébastien Moretti wrote: > > > I use --vanilla --quiet --slave options on command line but I always get > Loading required package: ... > > R 2.5.1 > > .. and make sure you update your R installation. We are at 2.11.1 currently. Dieter -- View this message in context: http://r.

Re: [R] pasting together 2 character arrays

2010-09-01 Thread David Reiner
Always good to have that fourth way, just in case > (Array3 <- as.vector(outer(Array2[-1], Array1, FUN=function(x, y) paste(y, > Array2[1], x, sep="." [1] "height.trt0.trt1" "height.trt0.trt2" "weight.trt0.trt1" "weight.trt0.trt2" "age.trt0.trt1""age.trt0.trt2" [7] "sex.trt0.trt1"

  1   2   >