[R] Fwd: trunc/floor a number -- strange bahaviour

2009-02-12 Thread Žroutík
Resolved. nchar(unlist(strsplit(as.character(n),"\\.")))[2] in the function: NumberPrecision <- function(n) { PocetCyklu <- 0 if(n != round(n)) { PocetCyklu <- nchar(unlist(strsplit(n,"\\.")))[2] } else { while(n == round(n)) { n <- n/10 PocetCyklu <- PocetCyklu + 1 } PocetCyklu <- PocetCyklu - 1

Re: [R] Aggregrate function

2009-02-12 Thread David Winsemius
Actually what was originally requested is returned by: xveg[xveg$tot %in% with(xveg, tapply(tot, loc, max)), c("loc","sp")] -- David Winsemius On Feb 12, 2009, at 5:59 PM, markle...@verizon.net wrote: it does and you get exactly what monica wanted if you take out the "sp and just return t

Re: [R] Aggregrate function

2009-02-12 Thread David Winsemius
I realized later that the which might not be necessary (and in addition was reminded privately). The %in% function returns a logical vector which works just as well with matrix or dataframe indexing as the numeric vector returned by which. -- David Winsemius On Feb 12, 2009, at 5:52 PM, D

Re: [R] adding S3 vs. S4 to a new package

2009-02-12 Thread Marc Schwartz
on 02/12/2009 10:42 PM Edna Bell wrote: > Dear R Gurus: > > I'm building a package and am wondering whether to use S3 or S4 methods. > > Any advice, please? > Thanks, > Edna Bell These two previous threads are probably a good place to start: https://stat.ethz.ch/pipermail/r-help/2006-January/08

[R] adding S3 vs. S4 to a new package

2009-02-12 Thread Edna Bell
Dear R Gurus: I'm building a package and am wondering whether to use S3 or S4 methods. Any advice, please? Thanks, Edna Bell __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] R Help

2009-02-12 Thread Marc Schwartz
on 02/12/2009 10:17 PM Marc Schwartz wrote: > on 02/12/2009 10:07 PM Stuart Jaffe wrote: >> Hi, >>I have a list of numbers (classified as a list) that contains integer(0) >> empty vectors. How do I convert those integer(0) into NAs? Thanks > > Presuming that you are referring to a list along t

Re: [R] R Help

2009-02-12 Thread Remko Duursma
x <- list(integer(0),1,2) x[sapply(x, length) > 0] - Remko Duursma Post-Doctoral Fellow Centre for Plant and Food Science University of Western Sydney Hawkesbury Campus Richmond NSW 2753 Dept of Biological Science Macquarie University North Ryde

Re: [R] R Help

2009-02-12 Thread Marc Schwartz
on 02/12/2009 10:07 PM Stuart Jaffe wrote: > Hi, >I have a list of numbers (classified as a list) that contains integer(0) > empty vectors. How do I convert those integer(0) into NAs? Thanks Presuming that you are referring to a list along the lines of: L <- list(1:5, integer(0), 2:4, integer

[R] R Help

2009-02-12 Thread Stuart Jaffe
Hi, I have a list of numbers (classified as a list) that contains integer(0) empty vectors. How do I convert those integer(0) into NAs? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-12 Thread Jason Rupert
Thank you for the guidance.   I gave the qreference, but I guess I don't get it.  What are the other plots that are generated?  It is my understanding that qreference only produces normal QQ plots, so should the take away be if my data distribution, the first plot, isn't similar to any of the

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread Berwin A Turlach
G'day all, On Thu, 12 Feb 2009 14:06:21 -0600 (CST) markle...@verizon.net wrote: > Hi Jason: below seems to work. you have to take the transpose because > the apply > returns the rows transposed. i'm also not sure how to make the NAs be > the last > ones but maybe someone can show us how to do

[R] The effect of MLE and MME to probability of rejection

2009-02-12 Thread Wa Wrathall
Hi I am beginner with R I would like to compare the performance of Maximum likelihood Estimator (MLE) and Method of Moment Estimator (MME) effect probability of rejection, p. My MLE is x=rlnorm(10,meanlog = 2, sdlog =5) x xbar=mean(x) ssqrt=var(x) xbar ssqrt #MLE y=log(x) m1=mean(y

Re: [R] SAS Institute Adding Support for R

2009-02-12 Thread milton ruser
Dear all, I was thinking how much of R capabilities SAS Institute could incorporate on SAS support? Cheers miltinho brazil On Thu, Feb 12, 2009 at 6:04 PM, Frank E Harrell Jr < f.harr...@vanderbilt.edu> wrote: > Muenchen, Robert A (Bob) wrote: > >> Hi Folks, >> >> >> SAS Institute is adding off

[R] Running examples failed (but there are none).

2009-02-12 Thread Remko Duursma
Dear R-helpers, making a package (windowsXP), that includes a bunch of functions, but none have examples (all example code is within \dontrun{} blocks). I do R CMD check Maeswrap, all bits get OK-ed, except: "Running examples in 'Maeswrap-Ex.R' failed." When I run the 'Maeswrap-Ex.R' file mysel

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread Gabor Grothendieck
Here is one other solution. Its nearly the same as the last but uses ts instead of zoo: > all3 <- do.call(cbind, lapply(apply(peaks, 1, unique), ts)) > colnames(all3) <- make.names(1:ncol(all3)) > all3 Time Series: Start = 1 End = 5 Frequency = 1 X1 X2 X3 1 2 10 1 2 7 6 9 3 9 8 7 4 NA N

Re: [R] Adding abline in Lattice graph

2009-02-12 Thread Sundar Dorai-Raj
Sorry, that was my lack of understanding on how coplot works. Try the following: coplot(lbxglu~lbxgh|eth, data = reg.dat.5, panel= function(...) { panel.smooth(...) abline(h = 126, col = "red") abline(v = 6.5, col = "blue") }, xlab="ABC", ylab="FBG") On Thu, Feb 12, 2009 at

Re: [R] Problems in Recommending R

2009-02-12 Thread Rolf Turner
On 13/02/2009, at 1:15 PM, Wensui Liu wrote: my personal feeling about R website is that it is as good as how it should be. i don't have any problem to navigate around and know exactly where I can find the thing that I need. instead, knime.org website looks too fancy and is all about marketin

Re: [R] Problems in Recommending R

2009-02-12 Thread Wensui Liu
my personal feeling about R website is that it is as good as how it should be. i don't have any problem to navigate around and know exactly where I can find the thing that I need. instead, knime.org website looks too fancy and is all about marketing. i don't think it is necessary for R team to wast

[R] Graph Edit Distance

2009-02-12 Thread Thomas Allen
Dear R Users I'm trying to acquire a metric for how similar two graphs are by doing inexact graph matching. I heard that the "Graph Edit Distance" is one such metric. Do you know of any R packages (off the top of your head) that implement an algorithm for calculating this from a pair of adjacency

Re: [R] Adding abline in Lattice graph

2009-02-12 Thread Sundar Dorai-Raj
Try: coplot(lbxglu~lbxgh|eth, data = reg.dat.5, panel= function(...) { panel.smooth(...) panel.abline(h = 126, col = "red") panel.abline(v = 6.5, col = "blue") }, xlab="ABC", ylab="FBG") Also note that you removed your "with" call and give coplot a data argument. HTH, --sunda

[R] Adding abline in Lattice graph

2009-02-12 Thread Veerappa Chetty
Hi,I would like add a horizontal line at 126 (col=red) and a vertical line at 6.5 ( col= blue) in each panel .How should I use the panel.abline function in the following code I am using: -- library(lattice) with(reg.dat.5,coplot(lbxglu~lbxgh|eth,panel=panel.smooth,xlab="ABC", ylab="

Re: [R] ggobi install

2009-02-12 Thread Michael Bibo
Mark Ungrin utoronto.ca> writes: > > * Installing *source* package 'RGtk2' ... > > checking for pkg-config... /usr/bin/pkg-config > > checking pkg-config is at least version 0.9.0... yes > > checking for LIBGLADE... no > > configure: WARNING: libglade not found > > checking for INTROSPECTION... n

Re: [R] Different labels for subsets of points in a PCA or RDA biplot

2009-02-12 Thread David Hewitt
Thanks Gavin. Your advice and a little digging got me what I needed. Sorry for not specifying the correct function RE: 'labels' -- I was referring to text() as described in the ordiplot help page. Anyway, here's a code example of what I wanted to do. Probably not the most elegant solution, but it

Re: [R] Aggregrate function

2009-02-12 Thread markleeds
it does and you get exactly what monica wanted if you take out the "sp and just return the whole thing. thanks. On Thu, Feb 12, 2009 at 5:52 PM, David Winsemius wrote: aggregate and by are convenience functions of tapply. Consider this alternate solution: xveg[which(xveg$tot %in% with(xv

Re: [R] Aggregrate function

2009-02-12 Thread David Winsemius
aggregate and by are convenience functions of tapply. Consider this alternate solution: xveg[which(xveg$tot %in% with(xveg, tapply(tot, loc, max))),"sp"] It uses tapply to find the maximums by loc(ations) and then to goes back into xveg to find the corresponding sp(ecies). You should do testing

Re: [R] Problems in Recommending R

2009-02-12 Thread Kingsford Jones
On Thu, Feb 12, 2009 at 3:12 PM, Johannes Huesing wrote: > Last time I tried, rseek.org yielded no results when searching for "inferno". ...although, if you hit the 'Support Lists' tab it finds the thread in which Patrick announced it. > > -- > Johannes Hüsing There is something

Re: [R] Optimizing Multiple Models...any suggestions?

2009-02-12 Thread Gabor Grothendieck
See: http://cran.r-project.org/web/views/Optimization.html On Thu, Feb 12, 2009 at 11:31 AM, Paul Heinrich Dietrich wrote: > > There are multiple marketing models in place to predict individual-level > probabilities of whether or not someone would respond to a solicitation, > whether or not they

[R] Error Message: Error in dim(data) <- dim : attempt to set an attribute on NULL

2009-02-12 Thread Sally
I have the following code, from which I get the following error message: Error in dim(data) <- dim : attempt to set an attribute on NULL I think the error is coming from the part of my code in BOLD RED. The script works fine until then. #Load libraries source("http://bioconductor.org/biocL

[R] Setting optimizer in lme

2009-02-12 Thread Ron Burns
I am using R 2.7.0 on a linux platform. I am trying to reproduce a 2002 example using lme from the nlme library. I want to change the otimizer from the default (nlminb) to optim. Specifically, this is what I am trying to do: R> library(nlme) R> library(car) # for data only R> data(Blackmoor) #

Re: [R] Problems in Recommending R

2009-02-12 Thread Johannes Huesing
Andrew Choens [Thu, Feb 12, 2009 at 04:56:33PM CET]: > * Quick-R - http://www.statmethods.net/ > * The R Inferno - www.burns-stat.com/pages/Tutor/R_inferno.pdf > * Rseek.org As an aside: Last time I tried, rseek.org yielded no results when searching for "inferno". --

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread Bert Gunter
At the risk of beating the decaying skeletal remains of the stone dead horse, a one-liner: t(apply(mat,1,function(x)c(unique(x),rep(NA,sum(duplicated(x)) (probably more efficient as a 2-liner that calls duplicated/unique only once, though) -- Bert Gunter, Genentech -Original Message

Re: [R] Aggregrate function

2009-02-12 Thread Phil Spector
Monica - Here's a more compact version of the same idea: do.call(rbind,by(xveg,xveg['loc'],function(x)x[x$tot == max(x$tot),])) - Phil Spector Statistical Computing Facility

Re: [R] Problem with loading rJava in R

2009-02-12 Thread Dieter Menne
charis kaskiris.com> writes: > > > Thank you for helping. > > I am running the 32-bit version of R on a 64-bit Windows XP machine. After > reinstalling the rJava package I started getting a windows pop up with the > message: > > Rgui.exe - Unable to Locate Component > "This application has fa

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread Wacek Kusnierczyk
markle...@verizon.net wrote: > Thanks Rolf. very nice but "pretty easy" is ALWAYS a relative statement. > right. it's even "easier": na.last = function(x) { na = is.na(x) c(x[!na], x[na]) } > > > On Thu, Feb 12, 2009 at 3:59 PM, Rolf Turner wrote: > >> On 13/02/2009, at 9:06 AM, ma

Re: [R] Aggregrate function

2009-02-12 Thread Christos Hatzis
This requires a small modification to use which instead of which.max that returns only the first maximum: do.call("rbind", lapply(split(xveg, xveg$loc), function(x) x[which(x$tot == max(x$tot)), ])) loc sp tot L1L1 b 60 L2.5 L2 d 25 L2.7 L2 e 25 L3L3 b 68 -Christos > ---

Re: [R] Aggregrate function

2009-02-12 Thread Monica Pisica
Hi, Thanks for the solution. Mark Leeds sent me privately a very similar solution. My next question to him was: Suppose that for a certain location 2 species have the same maximum total ... (there are ties in the data for a particular location). How do i get all species that have that max.

Re: [R] Problem with loading rJava in R

2009-02-12 Thread charis
Thank you for helping. I am running the 32-bit version of R on a 64-bit Windows XP machine. After reinstalling the rJava package I started getting a windows pop up with the message: Rgui.exe - Unable to Locate Component "This application has failed to start because jvm.dll was not found. Re-inst

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread markleeds
Thanks Rolf. very nice but "pretty easy" is ALWAYS a relative statement. On Thu, Feb 12, 2009 at 3:59 PM, Rolf Turner wrote: On 13/02/2009, at 9:06 AM, markle...@verizon.net wrote: Hi Jason: below seems to work. you have to take the transpose because the apply returns the rows transposed

Re: [R] Messing with the "..." argument

2009-02-12 Thread Wacek Kusnierczyk
here's an example which may give you a hint -- it is not supposed to solve your particular problem: f = function(...) list(...) g = function(...) { args = list(...) names = names(args) if (is.null(names)) f(...) else do.call(f, args[names(args) != 'foo']) } g()

Re: [R] SAS Institute Adding Support for R

2009-02-12 Thread Frank E Harrell Jr
Muenchen, Robert A (Bob) wrote: Hi Folks, SAS Institute is adding official support for R: http://support.sas.com/rnd/app/studio/Rinterface2.html Cheers, Bob It's interesting that their model (using R within PROC IML) does not integrate with SAS itself. Try running PROC GLM within

[R] Sign differences amoung QR solutions.

2009-02-12 Thread rkevinburton
I was noticing mainly sign differences amoung the solutions to QR decomposition. For example R: > x <- matrix(c(12,-51,4,6,167,-68,-4,24,-41),nrow=3,byrow=T) > x [,1] [,2] [,3] [1,] 12 -514 [2,]6 167 -68 [3,] -4 24 -41 > r <- qr(x) > r$qr [,1] [,2] [,3]

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread Rolf Turner
On 13/02/2009, at 9:06 AM, markle...@verizon.net wrote: Hi Jason: below seems to work. you have to take the transpose because the apply returns the rows transposed. i'm also not sure how to make the NAs be the last ones but maybe someone can show us how to do that. Pretty easy: na.at.end <-

Re: [R] Aggregrate function

2009-02-12 Thread Christos Hatzis
I don't have an easy solution with aggregate, because the function in aggregate needs to return a scalar. But the following should work: do.call("rbind", lapply(split(xveg, xveg$loc), function(x) x[which.max(x$tot), ])) loc sp tot L1 L1 b 60 L2 L2 e 30 L3 L3 b 68 -Christos > -O

[R] Reading "attachment" mails on the R-help mailing list

2009-02-12 Thread ravi
Hi, I have a minor problem in reading some mail on the R-help list. On opening these mails, I get a message resembling the following : An embedded and charset-unspecified text was scrubbed... Name: not available URL:

[R] SAS Institute Adding Support for R

2009-02-12 Thread Muenchen, Robert A (Bob)
Hi Folks, SAS Institute is adding official support for R: http://support.sas.com/rnd/app/studio/Rinterface2.html Cheers, Bob = Bob Muenchen (pronounced Min'-chen), Manager, Research Computing Support U of TN Office of Infor

Re: [R] Messing with the "..." argument

2009-02-12 Thread Steve Lianoglou
Hi Duncan, > ... > I don't think so, but an alternative is to put together a parameter list > and call do.call(). For example, > ... Nice! Yeah, that did the trick quite well ... Thanks, -steve __ R-help@r-project.org mailing list https://stat.eth

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread markleeds
Hi Jason: below seems to work. you have to take the transpose because the apply returns the rows transposed. i'm also not sure how to make the NAs be the last ones but maybe someone can show us how to do that. mat <- matrix(c(2,7,2,7,9,10,10,6,8,6,1,9,7,2,0),byrow=TRUE,nrow=3) print(mat) t(app

Re: [R] Looping multiple output values to dataframe

2009-02-12 Thread Stropharia
Thanks a lot Levi. Your code was much shorter and more elegant. With a few minor alterations I got this (see below) to work. Does anyone know if there is a way to automate getting only the csv filenames in a folder (rather than the whole file path)? Or to automate extracting the file names from t

Re: [R] Messing with the "..." argument

2009-02-12 Thread Duncan Murdoch
On 2/12/2009 2:34 PM, Steve Lianoglou wrote: Hi all, Sorry if this is documented somewhere, but trying to search and google for ways to alter my "..." argument is having me chasing my tail. Is there someway that I can manipulate the elements in "..."? Specifically I'd like to use certain var

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread Gabor Grothendieck
Try this. After the apply from your post we use lapply to make each series into a zoo series so that we can later use zoo's multiway merge. Finally we actually merge them and in the next statement just makes nice column names: > library(zoo) > all3 <- do.call(merge, lapply(apply(peaks, 1, uniqu

[R] analogue to "lines" commant in "plot" when using boxplot

2009-02-12 Thread Dimitri Liakhovitski
Hello! I am finding "dotplot" really useful in generating the graph I need. I was able to make it work for one vector (data series in Excel language). However, I want to add the secon line to my graph - based on another vector (data series). What command should I use for this purpose in dotplot?

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread Jorge Ivan Velez
Dear Jason, Try this: x<-matrix(scan(),byrow=TRUE,ncol=5) 27279 10 10686 19720 res<-apply(x,1,unique) # Unique values maxlength<-max(do.call(c,lapply(res,length))) # Maximum length of unique values # Your matrix do.call(rbind,lapply(res,function(x

[R] Messing with the "..." argument

2009-02-12 Thread Steve Lianoglou
Hi all, Sorry if this is documented somewhere, but trying to search and google for ways to alter my "..." argument is having me chasing my tail. Is there someway that I can manipulate the elements in "..."? Specifically I'd like to use certain vars in "...", then remove them from "..." and pas

Re: [R] Aggregrate function

2009-02-12 Thread Jorge Ivan Velez
Dear Monica, Try this xveg[with(xveg, tot %in% tapply(tot,loc,max)),] HTH, Jorge On Thu, Feb 12, 2009 at 1:58 PM, Monica Pisica wrote: > > Hi, > > I have to recognize that i don't fully understand the aggregate function, > but i think it should help me with what i want to do. > > xveg is a

[R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-12 Thread Jason Shaw
Hi, I'm trying to take a matrix such as [,1] [,2] [,3] [,4] [,5] [1,]27279 [2,] 10 10686 [3,]19720 and generate a new matrix which contains only the unique values in each row: [,1] [,2] [,3] [,4] [,5] [1,]279 NA N

Re: [R] Looping multiple output values to dataframe

2009-02-12 Thread Levi Waldron
Stropharia wrote: # START R-CODE--- filenames <- Sys.glob("/Users/Desktop/Test/*.csv") # get names of files to process # use * to get all variables <- data.frame(1:length(filenames)) # preallocate assuming multiple values f

Re: [R] Eror message: not a valid package -- installed < 2.0.0

2009-02-12 Thread Powers, Randall - BLS
You are correct. I am definitely an inexperienced, untrained beginner. I will read the info in the link. I did think to put /usr/ccs/bin in the Root path (I am doing this logged in as Root). When I typed make this time, it actually goes through a long process, but ends with these error messages.

Re: [R] contour plot or persp plot with log scale?

2009-02-12 Thread Duncan Murdoch
On 2/12/2009 12:04 PM, Gilbert Brenes wrote: Hi. Is it possible to draw a contour plot (with contour or filled contour) or a a surface plot (with persp or persp3d) with the z axis in a log scale? For persp or persp3d I think you'd have to do the log transformation yourself. For example, x

[R] ggobi install

2009-02-12 Thread Mark Ungrin
hi - not sure if this is the right spot to ask for help on this, probably a basic question... I am trying to install ggobi on R running on Ubuntu Hardy - I am new to both Linux & R so the answer may be obvious & I'm just missing it. I have installed GGobi via synaptic, but trying to install rg

[R] Optimizing Multiple Models...any suggestions?

2009-02-12 Thread Paul Heinrich Dietrich
There are multiple marketing models in place to predict individual-level probabilities of whether or not someone would respond to a solicitation, whether or not they would become a customer, and if they did become a customer, how much money the company is likely to make. Each individual receives

[R] variable values

2009-02-12 Thread Tim Smith
Hi all, I was working with some probabilities and wanted to store some small values. For example: > x = 2e-250 > x [1] 2e-250 > y = 2e-300 > y [1] 2e-300 > z = 2e-350 > z [1] 0 Is there any way to store a small value (e.g. 2e-350) in R? thanks! [[alternative HTML version del

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-12 Thread Juliet Hannah
You may find the qreference function in the DAAG package helpful. It makes several QQ plots to give a sense of what kind of fluctuations can be expected. You can also construct a series of any plots you are interested in (using different distributions), and modifying the code in this function may

[R] Aggregrate function

2009-02-12 Thread Monica Pisica
Hi, I have to recognize that i don't fully understand the aggregate function, but i think it should help me with what i want to do. xveg is a data.frame with location, species, and total for the species. Each location is repeated, once for every species present at that location. For each lo

Re: [R] Problem with loading rJava in R

2009-02-12 Thread Uwe Ligges
Or better ask, is the an 64-bit version of R? I only know of one commercial beta release ... If so, is this an rJava version made for this version of R? Does any Windows error message appear on your screen? Best, Uwe Ligges Rowe, Brian Lee Yung (Portfolio Analytics) wrote: Did you verify t

Re: [R] getting all pairwise combinations of elements in a character string

2009-02-12 Thread Levi Waldron
I like both of these solutions much better - thank you! -Levi -- Levi Waldron post-doctoral fellow Jurisica Lab, Ontario Cancer Institute Division of Signaling Biology IBM Life Sciences Discovery Centre TMDT 9-304D 101 College Street Toronto, Ontario M5G 1L7 _

Re: [R] contour plot or persp plot with log scale?

2009-02-12 Thread Uwe Ligges
Gilbert Brenes wrote: Hi. Is it possible to draw a contour plot (with contour or filled contour) or a a surface plot (with persp or persp3d) with the z axis in a log scale? At least for contour(), you can specify logarithmic breaks. Best, Uwe Ligges Gilbert ___

Re: [R] how to perform power analysis and sample sizeestimation/projection using R

2009-02-12 Thread Christos Hatzis
Ok. So you have a set of features, which when combined in a certain way predict a binary outcome, i.e. a multi-feature binary predictor. You have to decide first what is the hypothesis that you want to test regarding this predictor in the study that you're designing. E.g. that prediction accurac

Re: [R] Different labels for subsets of points in a PCA or RDA biplot

2009-02-12 Thread Gavin Simpson
On Thu, 2009-02-12 at 09:42 -0800, David Hewitt wrote: > I've tried a few things both with prcomp(), and rda() and its friends > in vegan (including biplot.rda and ordiplot), but can't find a > solution. I'd like to associate subsets of the points in a resulting > biplot ("sites" in the rda object)

Re: [R] Problem with lmer and wiki example

2009-02-12 Thread Dieter Menne
James Widman mi.nmfs.gov> writes: > > I am trying to duplicate the example by Spencer Graves in the wiki, > using lmer with the Nozzle data. > http://wiki.r-project.org/rwiki/doku.php?id=guides:lmer-tests > However the Chisq value and the fitAB values that are calculated are > different compar

[R] how to perform power analysis and sample size estimation/projection using R

2009-02-12 Thread Waverley
Hi, I have a question in regarding to how to perform power analysis and sample size estimation/projection using R? I know power.t.test. It works really well with only one feature analysis. I have a set of features which collectively can discriminate binary classes. I can do power.t.test for e

Re: [R] getting all pairwise combinations of elements in a character string

2009-02-12 Thread jim holtman
> combn(letters[1:5], 2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] "a" "a" "a" "a" "b" "b" "b" "c" "c" "d" [2,] "b" "c" "d" "e" "c" "d" "e" "d" "e" "e" > On Thu, Feb 12, 2009 at 12:20 PM, Levi Waldron wrote: > I'm able to do this as follows, but am wondering

[R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-12 Thread Jason Rupert
By any chance is any one aware of a website, book, paper, etc. or combinations of those sources that show plots of different distributions? After reading a pretty good whitepaper I became aware of the benefit of I the benefit of doing Q-Q plots and histograms to help assess a distribution.   The

[R] Problem with lmer and wiki example

2009-02-12 Thread James Widman
I am trying to duplicate the example by Spencer Graves in the wiki, using lmer with the Nozzle data. http://wiki.r-project.org/rwiki/doku.php?id=guides:lmer-tests However the Chisq value and the fitAB values that are calculated are different compared to those in the example. I also get a warning

[R] Looping multiple output values to dataframe

2009-02-12 Thread Stropharia
Dear R users, I have various vector geometry operations to perform on 3-D coordinate data located on multiple (500+) csv files. The code I have written for the calculations works just fine. I have written a 'for' loop to automate the task of extracting the coordinates from the files and perform t

[R] Different labels for subsets of points in a PCA or RDA biplot

2009-02-12 Thread David Hewitt
I've tried a few things both with prcomp(), and rda() and its friends in vegan (including biplot.rda and ordiplot), but can't find a solution. I'd like to associate subsets of the points in a resulting biplot ("sites" in the rda object) with different plotting colors/text styles to emphasize certai

Re: [R] getting all pairwise combinations of elements in a characterstring

2009-02-12 Thread Wills, Kellie
How about m <- outer(mystring, mystring, paste, sep="") m[upper.tri(m)] Kellie Wills -Original Message- From: r-help-boun...@r-project.org on behalf of Levi Waldron Sent: Thu 2/12/2009 12:20 PM To: r-help@r-project.org Subject: [R] getting all pairwise combinations of elements in a char

Re: [R] get top 50 correlated item from a correlation matrix for each item

2009-02-12 Thread JLucke
A solution using a toy example r <- cor(mvrnorm(1000,mu=rep(0,10),Sigma=diag(10))) #assume a 10 x 10 matrix j <- i<-1:dim(r)[1] #generate matrix indices lt <- outer(i,j,'>') #get boolean lower triangle sort(r[lt],decreasing=TRUE)[1:5] #extract top 5 correlations Joseph F. Lucke Senior Statis

Re: [R] get top 50 correlated item from a correlation matrix for each item

2009-02-12 Thread Tan, Richard
Works like a charm, thank you! -Original Message- From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] Sent: Thursday, February 12, 2009 12:11 PM To: Tan, Richard Cc: r-help@r-project.org Subject: Re: [R] get top 50 correlated item from a correlation matrix for each item a possi

[R] getting all pairwise combinations of elements in a character string

2009-02-12 Thread Levi Waldron
I'm able to do this as follows, but am wondering if anyone knows a simpler way which still avoids explicit loops? > (mystring <- letters[1:5]) [1] "a" "b" "c" "d" "e" > unlist(sapply(mystring[-length(mystring)], + function(x) paste(x,mystring[(grep(x,mystring)+1):length(mystring)]

Re: [R] repost: problems with lm for nested fixed-factor Anova (ANOVA I)

2009-02-12 Thread Richard M. Heiberger
tmp <- data.frame(y=rnorm(15000), x1 <- factor(sample(48, 15000, replace=TRUE)), z1 <- factor(sample(242, 15000, replace=TRUE))) system.time( tmp.aov <- aov(y ~ x1/z1, data=tmp) ) ## exceeds memory tmp2 <- data.frame(y=rnorm(15000),

Re: [R] get top 50 correlated item from a correlation matrix for each item

2009-02-12 Thread Dimitris Rizopoulos
a possible vectorized solution is the following: cor.mat <- cor(matrix(rnorm(100*1000), 1000, 100)) p <- 30 # how many top items n <- ncol(cor.mat) cmat <- col(cor.mat) ind <- order(-cmat, cor.mat, decreasing = TRUE) - (n * cmat - n) dim(ind) <- dim(cor.mat) ind <- ind[seq(2, p + 1), ] out <- cb

[R] contour plot or persp plot with log scale?

2009-02-12 Thread Gilbert Brenes
Hi. Is it possible to draw a contour plot (with contour or filled contour) or a a surface plot (with persp or persp3d) with the z axis in a log scale? Gilbert __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] Eror message: not a valid package -- installed < 2.0.0

2009-02-12 Thread Ben Bolker
./configure --help gives a list of configuration options. I'm not sure, but it looks like there might be a problem building bzip libraries -- not sure why. http://cran.r-project.org/doc/manuals/R-admin.pdf has Solaris building notes for Solaris, but the only mention of bzip2 in the manual se

Re: [R] Tilde in boxplots

2009-02-12 Thread Bert Gunter
boxplot is an (S3) generic function: ?UseMethod 1. Uses the default method. 2. Uses the formula method, since biomass~clipping is a formula: ?"~" ; ?formula; ?boxplot. See also an Introduction to R where these matters are also explained. -- Bert Gunter, Genentech -Original Message- Fr

Re: [R] beginner's question: group of regressors by name vector?

2009-02-12 Thread Gabor Grothendieck
If DF is a data frame with the variables, try this: lm(l ~. , DF[c("l", "b", "j", "x")) On Thu, Feb 12, 2009 at 11:11 AM, wrote: > dear r-experts: there is probably a very easy way to do it, but it eludes > me right now. I have a large data frame with, say, 26 columns named "a" > through "z".

Re: [R] repost: problems with lm for nested fixed-factor Anova (ANOVA I)

2009-02-12 Thread Sergii Ivakhno
Deal All I am terribly sorry for forgetting to provide a toy example. Obviously it can not reproduce the problem of the running t ime. x1=c(rep(1,25),rep(2,25),rep(3,50)) z1=c(rep(1,12),rep(2,13),rep(3,12),rep(4,13),rep(5,12),rep(6,13),rep(7,2 5)) y1 = rnorm(100,0,1) anov1=lm(c(as.vector(y

Re: [R] beginner's question: group of regressors by name vector?

2009-02-12 Thread David Freedman
The predictors and outcomes in lm can be matrices, so you could use something like the following: x.mat=cbind(x1=rnorm(20),x2=rnorm(20)) y.mat=cbind(y1=rnorm(20),y2=rnorm(20)) lm(y.mat~x.mat) David Freedman ivowel wrote: > > dear r-experts: there is probably a very easy way to do it, but it e

Re: [R] beginner's question: group of regressors by name vector?

2009-02-12 Thread Gabor Grothendieck
Missed a bracket: lm(l ~. , DF[c("l", "b", "j", "x")]) On Thu, Feb 12, 2009 at 11:21 AM, Gabor Grothendieck wrote: > If DF is a data frame with the variables, try this: > > lm(l ~. , DF[c("l", "b", "j", "x")) > > > On Thu, Feb 12, 2009 at 11:11 AM, wrote: >> dear r-experts: there is probably a

Re: [R] Eror message: not a valid package -- installed < 2.0.0

2009-02-12 Thread Powers, Randall - BLS
Thanks, that helps some. When I search for make, it appears in a number of places: # find / -name make -print /usr/share/lib/make /usr/ccs/bin/make /usr/xpg4/bin/make /usr/local/lib/R/library/R-2.8.1/share/make /usr/local/lib/R/share/make /usr/local/lib/R-2.8.1/share/make /apps/oracle/product/10

Re: [R] Eror message: not a valid package -- installed < 2.0.0

2009-02-12 Thread Powers, Randall - BLS
I am running 2.6.0 because I can't seem to get 2.8.1 configured properly. When I do ./configure, it goes through a long list, and ends with configure: error: --with-iconv=yes (default) and a suitable iconv is not available When I run make, I get the message below. # make make: not found So

[R] get top 50 correlated item from a correlation matrix for each item

2009-02-12 Thread Tan, Richard
Hi, I have a correlation matrix of about 3000 items, i.e., a 3000*3000 matrix. For each of the 3000 items, I want to get the top 50 items that have the highest correlation with it (excluding itself) and generate a data frame with 3 columns like ("ID", "ID2", "cor"), where ID is those 3000 items

[R] iTRAQ normalization

2009-02-12 Thread Marco Chiapello
Hi all, I need to normalized iTRAQ data. I have a table like this: C8/C2 A2/C2 A8/C2 1 1.2 1.1 1.5 2 0.2 0.9 0.2 3 1 0.1 0.1 4 1.1 1.1 0.9 ... ... .

[R] gamma regression (Zelig package)

2009-02-12 Thread soetzel
Hey, I want to estimate to regressions. First I want to estimate simple OLS. Since my dependent variable looks like a gamma distribution I want to estimate a gamme regression with the "zelig" package. But, I have some problems with the interpretation of the estimated coefficient. In the OLS the

[R] Tilde in boxplots

2009-02-12 Thread Petter Hedberg
Best contributors to the R-project. I have noticed that when using boxplot diagrams, R interprets the following two inputs very differently. 1: boxplot(biomass,clipping) 2:boxplot(biomass~clipping) What is the significance of tilde in the boxplot graph. I have not found it as one of the argumen

Re: [R] Eror message: not a valid package -- installed < 2.0.0

2009-02-12 Thread Ben Bolker
From the R directory, after configuring successfully, try /usr/ccs/bin/make Do read the INSTALL manual, as BDR suggested ... that also suggests MAKE=/usr/ccs/bin/make $MAKE (instead of "make") it also sounds like you're inexperienced with building software (apologies if not true), so the I

[R] beginner's question: group of regressors by name vector?

2009-02-12 Thread ivowel
dear r-experts: there is probably a very easy way to do it, but it eludes me right now. I have a large data frame with, say, 26 columns named "a" through "z". I would like to define "sets of regressors" from this data frame. something like myregressors=c("b", "j", "x") lm( l ~ myregressors,

Re: [R] Problems in Recommending R

2009-02-12 Thread Andrew Choens
I agree with those who would like to see the R-Project's site redone. If/when it is redone, I think there should be more emphasis on providing links / access to useful materials for new users. I find it interesting that this discussion has been very focused on the technologies that should be used,

Re: [R] System.time

2009-02-12 Thread Gavin Simpson
On Thu, 2009-02-12 at 09:42 -0500, Stavros Macrakis wrote: > On Thu, Feb 12, 2009 at 4:28 AM, Gavin Simpson > wrote: > > When I'm testing the speed of things like this (that are in and of > > themselves > > very quick) for situations where it may matter, I wrap the function call in > > a call >

[R] repost: problems with lm for nested fixed-factor Anova (ANOVA I)

2009-02-12 Thread Sergii Ivakhno
Dear R users, I have posted this question several days ago and received not a single suggestion. I believe I have provided sufficient information for at least some help. Here I repost the question with several modifications. I want to run nested fixed-factor Anova in R on different experiments. I

Re: [R] trunc/floor a number -- strange bahaviour

2009-02-12 Thread Duncan Murdoch
On 2/12/2009 10:20 AM, Žroutík wrote: Hi everybody, given a fresh rgui.exe load on winxp OS, I enter (a minimal exaple) n <- 12.357531 Then the following command: n <- (n - floor(n))*10; n gives the following outputs: [1] 3.57531 [1] 5.7531 [1] 7.531 [1] 5.31 [1] 3.1 [1] 1 === still a

  1   2   >