Re: [R] How to specify R CMD INSTALL arguments

2010-02-20 Thread Patrick Connolly
On Fri, 19-Feb-2010 at 11:03PM +1300, Patrick Connolly wrote: |> I've become a bit rusty using R CMD INSTALL from the shell prompt |> since the install.packages normally works so well. |> |> One of the arguments to R CMD INSTALL is --configure-args=ARGS |> |> >From looking at the rsprng package'

[R] deficient rank question

2010-02-20 Thread Ralph.Montenegro
Hi everyone. I am a new user of R so thanks for your help! I'm running a regression and receive an error that states that the "residuals have rank 45 < 169." What does this mean? Thanks! -- View this message in context: http://n4.nabble.com/deficient-rank-question-tp1562644p1562644.html Sent

Re: [R] What is the difference between expression and quote whenused with eval()?

2010-02-20 Thread Romain Francois
On 02/19/2010 10:31 PM, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of blue sky Sent: Friday, February 19, 2010 12:11 PM To: Peter Dalgaard Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] What is the differenc

Re: [R] Add lines (contours) to lattice wireframe plot

2010-02-20 Thread Andrej
I do it myself. Here is the "solution". require(lattice) # Bivariate density function dnorm2d <- function(x, y, rho = 0) { xoy = (x^2 - 2 * rho * x * y + y^2)/(2 * (1 - rho^2)) density = exp(-xoy)/(2 * pi * sqrt(1 - rho^2)) density } # Surface data surface.data <- expand.grid(x = seq(from

Re: [R] Omitting members of a sequence

2010-02-20 Thread Jim Lemon
On 02/20/2010 08:33 AM, Stuart Luppescu wrote: Hello, this is just a point of curiosity with me. I want a sequence of numbers from 64 to 70, omitting the 2nd and 4th numbers. I can do it these ways: seq(64, 70)[-c(2, 4)] [1] 64 66 68 69 70 foo<- 64:70 foo[-c(2, 4)] [1] 64 66 68 69 70 But h

Re: [R] inverse lexicographical ordering

2010-02-20 Thread Evgenia
Thanks for your help. Finally I found the solution to this problem for any matrix without having to know its number of columns I write it down in case someone else needed it. #Creation of b matrix ncol<-3 b <- matrix(0, 2^ncol, ncol) for (i in 1:ncol) b[, ncol+1-i] <- rep(rep(c

Re: [R] Print table in lme

2010-02-20 Thread Dieter Menne
Daniel-6 wrote: > > Hello, I'm trying to add lme results in a table with lm coef results, but > as > I know, estout or xtabel cannot support lme objects. > I'm a new in R and I'll appreciate some helpful comments. > I don't know what estout and xtabel do, but if you want to extract the core r

Re: [R] ggplot2 X axis levels

2010-02-20 Thread Dieter Menne
Felipe Carrillo wrote: > > Hi all: > I've done this before with factors but can't figure how to do it with > a continuous variable. I am trying to reorder the sequence of my weeks > along the X axis. I want to start with week 27 to 52 and then 1 to 26. > I guess I could use levels along with seq

Re: [R] LaTeX/R/Sweave Problems

2010-02-20 Thread Dieter Menne
tudor wrote: > > ... To overcome the fact that the R installation had spaces in the path, I > just had the corresponding Sweave.sty in the folder where my .Rnw and .tex > files were located and used \usepackage{Sweave} in the preamble of the > .Rnw file. > Assuming that you are working on Win

[R] R died on large data set

2010-02-20 Thread Marcelo Laia
Hi, I am trying to run a script on R and it died before finish. I already read the list archives, and memory help pages (http://tinyurl.com/yaxco6w), but I am unable to solve the issue. My Debian shows: marc...@laia:~$ ulimit unlimited marc...@laia:~$ On system monitor (gnome) I see that R reac

[R] Rearranging a data frame for multiple observations

2010-02-20 Thread Newbie19_02
Hi there, I think I'm struggling with a fairly simple problem but can't seem to solve it. I have multiple observations for one unique identifier. Ultimately I want to end up with one line per identifier with multiple observations in rows. I'm really stuck any help would be really appreciated.

Re: [R] R died on large data set

2010-02-20 Thread Henrik Bengtsson
Some suggestions: The line: pearson.dist <- as.dist(1-cor(t(todos.norm), method="pearson")) includes several data manipulations in "one go". Each manipulation creates at least one extra copy of your data in memory. When you do it this, you make it harder for the R garbage collector to clean o

Re: [R] Rearranging a data frame for multiple observations

2010-02-20 Thread jim holtman
Is this what you want: > x <- read.table(textConnection("CAO0337134 05/09/95 + CAO0337134 27/09/05 + CAO0347741 10/10/04 + CAO0347741 12/10/04 + CAO0367128 11/07/05 + CAO0367128 12/07/05 + CAO0367128 14/07/05 + CAO0367128 19/09/97 + CAO0367128 20/09/97

Re: [R] R died on large data set

2010-02-20 Thread jim holtman
What is 'died'? What is the error message? On Sat, Feb 20, 2010 at 7:13 AM, Marcelo Laia wrote: > Hi, I am trying to run a script on R and it died before finish. > > I already read the list archives, and memory help pages > (http://tinyurl.com/yaxco6w), but I am unable to solve the issue. > > M

Re: [R] LaTeX/R/Sweave Problems

2010-02-20 Thread tudor
Dieter: Thank you so much. I will give it a try asap. I really appreciate your feedback. Tudor Date: Sat, 20 Feb 2010 03:04:25 -0800 From: ml-node+1562751-1390487333-154...@n4.nabble.com To: tudor_bo...@hotmail.com Subject: Re: LaTeX/R/Sweave Problems tudor wrote: ... To overco

[R] How get the single bar x coordinate in barchart when groups is used?

2010-02-20 Thread Walmes Marques Zeviani
Hi all, I am using barchart() to plot values above the bars. When using groups argument we get bars grouped arround a given x level. By placing values above this bars we need to know the respective x coordinates. How can I get it? require(lattice) da <- expand.grid(x=1:5, z=1:3, w=1:2) da$y <-

Re: [R] Rename R package name on R-Forge

2010-02-20 Thread Brian G. Peterson
wenjun zheng wrote: Hi, R Users, Can maintainer rename the package on F-Forge? Any suggestions will be appreciated. use svn mv if your directory structure is pkg/ pkg/R/ pkg/man/ pkg/DESCRIPTION like that then create a directory under pkg that is the new package name that you want pkg

[R] Contingency Table - output to odfWeave not working for matrix

2010-02-20 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Hi guys I'm hoping someone can help me with this. It should be easy but it seems to get stuck for no obvious reason! I am trying to set a report up in odfWeave so that we can re-run the same analysis at 3 time points as the data matures and provide an 'instant' report. To simplify the situati

Re: [R] Contingency Table - output to odfWeave not working for matrix

2010-02-20 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Solved my own problem by using: odfTable.matrix( as.matrix ( with (mydata, table (site_id, reaction)) ) ) This message may contain confidential information. If yo...{{drop

Re: [R] Rearranging a data frame for multiple observations

2010-02-20 Thread Newbie19_02
Hi Jim, Your method works really well except that I lose the format of my dates and I'm not sure how to fix this? THanks, Natalie -- View this message in context: http://n4.nabble.com/Rearranging-a-data-frame-for-multiple-observations-tp1562780p1562836.html Sent from the R help mailing list ar

Re: [R] Rearranging a data frame for multiple observations

2010-02-20 Thread Henrique Dallazuanna
Try this: do.call(rbind, lapply(unstack(x, V2 ~ V1), '[', 1:max(with(x, tapply(V2, V1, length) On Sat, Feb 20, 2010 at 9:26 AM, Newbie19_02 wrote: > > Hi there, > > I think I'm struggling with a fairly simple problem but can't seem to solve > it.  I have multiple observations for one unique

Re: [R] Print table in lme

2010-02-20 Thread Douglas Bates
On Sat, Feb 20, 2010 at 4:28 AM, Dieter Menne wrote: > > > Daniel-6 wrote: >> >> Hello, I'm trying to add lme results in a table with lm coef results, but >> as >> I know, estout or xtabel cannot  support lme objects. >> I'm a new in R and I'll appreciate some helpful comments. >> > > I don't know

Re: [R] Rearranging a data frame for multiple observations

2010-02-20 Thread David Winsemius
Henrique; I wonder if you can comment on why that works as it does. I have tried to pull it apart and reassemble it piece by piece, but always end up with argument recycling. > do.call(rbind, c(unstack(x, V2 ~ V1)[1], unstack(x, V2 ~ V1)[3])) [,1] [,2] [,3] [,4]

Re: [R] Print table in lme

2010-02-20 Thread Dieter Menne
Douglas Bates-2 wrote: > > On Sat, Feb 20, 2010 at 4:28 AM, Dieter Menne > For most other model fitting functions the sequence > > coef(summary(mymodel)) > > works. Unfortunately, in the nlme package we assigned another meaning > to the coef method. In retrospect that wasn't the best idea. >

Re: [R] Print table in lme

2010-02-20 Thread Douglas Bates
On Sat, Feb 20, 2010 at 10:27 AM, Dieter Menne wrote: > > > Douglas Bates-2 wrote: >> >> On Sat, Feb 20, 2010 at 4:28 AM, Dieter Menne >> For most other model fitting functions the sequence >> >> coef(summary(mymodel)) >> >> works.  Unfortunately, in the nlme package we assigned another meaning >>

Re: [R] Rearranging a data frame for multiple observations

2010-02-20 Thread Newbie19_02
Dear Henrique, THanks this works in the way that I need it to. THanks for your help. Natalie -- View this message in context: http://n4.nabble.com/Rearranging-a-data-frame-for-multiple-observations-tp1562780p1562949.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Use of R in clinical trials

2010-02-20 Thread Dieter Menne
If you check http://n4.nabble.com/R-help-f789696.html you will note that this thread has the largest number of read since years. Looks like an encouragement to Mark to keep the mentioned CRAN document updated. To add a more serious note to my sarcastic comments earlier: I don't think the FDA o

[R] What is your system for WorkFlow and Source Code Organizing in R ?

2010-02-20 Thread Tal Galili
Hello dear R users, Recently there has been several fascinating threads on the website stackoverflow regarding the subject of R WorkFlow best practices: - What best practices do you use for programming in R?

[R] Error with KNN

2010-02-20 Thread Nancy Adam
Hi all I receive this error message: “Error in mymodel$MSE : $ operator is invalid for atomic vectors” When I use KNN. This is the code: library(e1071) train <- rbind(iris3[,,1], iris3[,,2], iris3[,,3]) cl <- factor(c(rep("s",50), rep("c",50), rep("v",50))) knn.cv(train, cl, k = 3, prob

Re: [R] LaTeX/R/Sweave Problems

2010-02-20 Thread RICHARD M. HEIBERGER
> > To overcome the fact that the R installation had > spaces in the path, The easiest way to deal with spaces is to use the 8.3 names in your paths. >From the DOS CMD window, enter dir /x and you will get the 8.3 names. For example dir /x/ad c:\pr* cd c:\progra~1\R dir /x/ad R-2.10.* Bas

Re: [R] Rearranging a data frame for multiple observations

2010-02-20 Thread Henrique Dallazuanna
David, Because the recycling, is needed index each element from 1 to maximum of length of the elements. ( '[' ). On Sat, Feb 20, 2010 at 1:31 PM, David Winsemius wrote: > Henrique; > > I wonder if you can comment on why that works as it does. I have tried to > pull it apart and reassemble it pie

[R] coerce (list) object to type 'double'

2010-02-20 Thread wendy
Dear all, I am really new to R, and I have problem here. I searched around, but did not get a solution. I have a numetrix matrix (20 by 25) saved in .csv. I read it as >sx<-read.csv("sx.csv",header=F) Then I try to convert it to numeric using >sx<-as.numeric(sx) Error: (list) object cannot be

Re: [R] coerce (list) object to type 'double'

2010-02-20 Thread jim holtman
I assume that what you want is a matrix from the dataframe that was read in: > x <- read.table(textConnection("1 2 3 + 4 5 6 + 7 8 9")) > > x V1 V2 V3 1 1 2 3 2 4 5 6 3 7 8 9 > str(x) 'data.frame': 3 obs. of 3 variables: $ V1: int 1 4 7 $ V2: int 2 5 8 $ V3: int 3 6 9 > x.n <-

[R] [R-pkgs] "tsne" package for t-SNE dimensionality reduction

2010-02-20 Thread Justin Donaldson
I'd like to announce the availability of the "tsne" package. It provides the T distributed Stocastic Neighbor Embedding algorithm by van der Maaten and Hinton: 1. http://ict.ewi.tudelft.nl/~lvandermaaten/t-SNE.html 2. L.J.P. van der Maaten and G.E. Hinton. Visualizing High-Dimensional

[R] [R-pkgs] new package RFLPtools

2010-02-20 Thread Dr. Matthias Kohl
The new package RFLPtools is available on CRAN. RFLPtools provides analysis functions for DNA fragment molecular weights (e.g.\ derived from RFLP-analysis) and nucleotide sequence similarities. It aims mainly at the identification of similar or identical fragment patterns to evaluate the amoun

[R] [R-pkgs] New solaR package

2010-02-20 Thread Oscar Perpiñan Lamigueiro
Hello. I'd like to announce the availability of version 0.14 of the "solaR" package. It provides a set of calculation methods of solar radiation and performance of photovoltaic systems. The package has been uploaded to CRAN and is now available under the GPL-3 license. Moreover, I have design

Re: [R] Contingency Table - output to odfWeave not working for matrix

2010-02-20 Thread Max Kuhn
Polwart Calum, Although I cannot explain the root issue, it has nothing to do with odfWeave. See the second command below. I don't know your versions etc blah blah blah... > class(with (mydata, table (site_id, reaction))) [1] "table" > class(as.matrix(with (mydata, table (site_id, reaction [1

[R] aggregating using 'with' function

2010-02-20 Thread AC Del Re
Hi All, I am interested in aggregating a data frame based on 2 categories--mean effect size (r) for each 'id's' 'mod1'. The 'with' function works well when aggregating on one category (e.g., based on 'id' below) but doesnt work if I try 2 categories. How can this be accomplished? # sample data i

[R] effective sample size in logistic regression w/spat autocorr

2010-02-20 Thread Seth
Hi, There's lit on how to adjust variance in the presence of positive spatial autocorrelation to properly inflate standard error estimates in linear regression by changing observed N to effective N. There is an R package to do this too. Is anyone aware of a way in R (or by hand) to do the same

Re: [R] Rearranging a data frame for multiple observations

2010-02-20 Thread Gabor Grothendieck
Very nice! On Sat, Feb 20, 2010 at 10:37 AM, Henrique Dallazuanna wrote: > Try this: > > do.call(rbind, lapply(unstack(x, V2 ~ V1), '[', 1:max(with(x, > tapply(V2, V1, length) > > On Sat, Feb 20, 2010 at 9:26 AM, Newbie19_02 wrote: >> >> Hi there, >> >> I think I'm struggling with a fairly s

Re: [R] aggregating using 'with' function

2010-02-20 Thread jim holtman
This seems to work fine (notice the missing 'c(...)'; why did you think you needed it); > with(datas, aggregate(list(r = r), by = list(id = id, mod1 = mod1),mean)) id mod1 r 1 11 0.980 2 41 0.640 3 71 0.490 4 101 0.180 5 12 0.295 6 52 0.490 7 8

Re: [R] What is the difference between expression and quote whenused with eval()?

2010-02-20 Thread blue sky
On Sat, Feb 20, 2010 at 2:40 AM, Romain Francois wrote: > On 02/19/2010 10:31 PM, William Dunlap wrote: >> >>> -Original Message- >>> From: r-help-boun...@r-project.org >>> [mailto:r-help-boun...@r-project.org] On Behalf Of blue sky >>> Sent: Friday, February 19, 2010 12:11 PM >>> To: Pete

[R] (no subject)

2010-02-20 Thread hussain abu-saaq
hi, I have question. I worte r function that suppsoe ti return x and y to me. when I use that function in the middle of a code ( i use source) it give me the value of x,y but when i write x,ro y it says (not found). so my question is that I want when i load this function to return the varibl

Re: [R] aggregating using 'with' function

2010-02-20 Thread AC Del Re
Perfect! Thanks Jim. Do you know how I could then reduce the data even further? Specifically, reducing it to 1 id per row? In this dataset, id 1 would have one row eliminated. Assume the data is much larger and cannot be deleted by visual inspection and elimination one row at a time. Thank you,

[R] how do I get the legend?

2010-02-20 Thread casperyc
http://en.wikipedia.org/wiki/Binomial_distribution Bino Hi there, How can I get the legend in the probability density plot in that http://en.wikipedia.org/wiki/File:Binomial_distribution_pmf.svg wiki page ? and the cumalative plot as well? # Binomial Dist

Re: [R] how do I get the legend?

2010-02-20 Thread Peter Ehlers
On 2010-02-20 18:50, casperyc wrote: http://en.wikipedia.org/wiki/Binomial_distribution Bino Hi there, How can I get the legend in the probability density plot in that http://en.wikipedia.org/wiki/File:Binomial_distribution_pmf.svg wiki page ? You can do this by studying help(legend). and

Re: [R] LaTeX/R/Sweave Problems

2010-02-20 Thread tudor
Richard: Thank you so much. I believe I have found the problem. Once I document it I will add it to my original post for everyone to be aware of it. Thanks. Tudor Date: Sat, 20 Feb 2010 12:29:02 -0800 From: ml-node+1563099-1061681052-154...@n4.nabble.com To: tudor_bo...@hotmail

Re: [R] svm

2010-02-20 Thread Amy Hessen
Hi , Could you please help me in this question:? After trying this code: library(e1071) mydata <- as.matrix(read.delim("iris.txt")) train.x <- mydata[,-1] train.y <- mydata[,1] mymodel <- svm(train.x, train.y, cross=3, type="C-classification") I receive this error: Error in colMeans(x

Re: [R] aggregating using 'with' function

2010-02-20 Thread jim holtman
I am not sure what you mean by eliminating a row. Now if you want only one copy of each 'id', and it is the first one, the you can use 'duplicated': > x <- with(datas, aggregate(list(r = r), by = list(id = id, mod1 = mod1),mean)) > x id mod1 r 1 11 0.980 2 41 0.640 3 7

Re: [R] (no subject)

2010-02-20 Thread jim holtman
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. You should at least include the function code you are talking about. A function will return a value that has

Re: [R] aggregating using 'with' function

2010-02-20 Thread AC Del Re
OK, this is great, Jim. Last question: How about if I want the 1 copy of each id to be selected randomly versus taking the first one? Thank you, AC > On Sat, Feb 20, 2010 at 8:37 PM, jim holtman wrote: >> I am not sure what you mean by eliminating a row.  Now if you want only one >> copy of ea

[R] replicate matrix

2010-02-20 Thread wendy
Hi all, I have a matrix, for example [,1] [,2] [1,] 13 [2,] 46 I want to replicate the matrix twice and add an extra column at the end, which is [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 13 13 132 [2,] 46 46 465 I found 'rep' o

Re: [R] LaTeX/R/Sweave Problems

2010-02-20 Thread tudor
Dear all: Thank you so much for all your feedback. Since based on your suggestions I was able to create a working R/Sweave/LaTex environment I summarize below the steps I followed to accomplish this task. I hope this approach could/may help others with similar problems. 1. Install R, Adobe Acr

Re: [R] replicate matrix

2010-02-20 Thread Joshua Wiley
Hello Wendy, The simplest solution that comes to mind is to just use cbind. For instance: > x <- matrix(1:4, nrow=2) > x [,1] [,2] [1,]13 [2,]24 > cbind(x,x,x,c(2,5)) # repeat x here as many times as needed [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,]1313

Re: [R] plot circular histogram

2010-02-20 Thread Gene Leynes
This might give you some ideas: http://addictedtor.free.fr/graphiques/thumbs.php Some examples that jumped out at me for your application: *Circular density estimate *http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=121 *Wind rose diagram *http://addictedtor.free.fr/graphiques/RGra

[R] a question about the command "followup.plot" of epicale package

2010-02-20 Thread 孟欣
Hi all: I have a question about the command "followup.plot" of epicale package. As to the demo data "Orthodont", the command "followup.plot" works well.But if I delete some rows of data(delete Male data,and keep Female data only, for instance),the command can't work,and the warning is "In attr(

Re: [R] replicate matrix

2010-02-20 Thread amarov
You can try something like: mtx <- matrix(1:4, ncol = 2) mtx.rep <- t(apply(mtx, 1, rep, r)) mtx.rep <- cbind(mrx.rep, new.column) where r is your desired number of replications . Hope it helps, Boyko Joshua Wiley-2 wrote: > > Hello Wendy, > > The simplest solution that comes to mind is t

Re: [R] aggregating using 'with' function

2010-02-20 Thread jim holtman
This will do it. You can see two different values for id=1: > x <- with(datas, aggregate(list(r = r), by = list(id = id, mod1 = mod1),mean)) > x id mod1 r 1 11 0.980 2 41 0.640 3 71 0.490 4 101 0.180 5 12 0.295 6 52 0.490 7 82 0.330 8 11

Re: [R] replicate matrix

2010-02-20 Thread Dimitris Rizopoulos
try this: mat <- matrix(c(1,4,3,6), 2, 2) cbind( do.call(cbind, rep(list(mat), 3)), c(2, 5) ) I hope it helps. Best, Dimitris wendy wrote: Hi all, I have a matrix, for example [,1] [,2] [1,] 13 [2,] 46 I want to replicate the matrix twice and add an extra column at

Re: [R] plot circular histogram

2010-02-20 Thread Jim Lemon
T.D. Rudol wrote: In conducting studies of animal orientation and displacement, I need to produce circular histograms of angles (bearings in radians 0-2pi) where the centre of the circle indicates very few observations for a given bin of angles and outwardly concentric circles indicate greater

Re: [R] replicate matrix

2010-02-20 Thread Linlin Yan
You can just rep() it, and c() with extra data, and then matrix() it again: > m <- matrix(c(1,4,3,6),2) > matrix(c(rep(m, 3), c(2, 5)), nrow(m)) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,]1313132 [2,]4646465 On Sun, Feb 21, 2010 at 10:58 AM,