Re: [R] Drawing from an empirical distribution

2009-01-06 Thread Matthias Kohl
one could also use package distr; e.g., library(distr) x <- 1:10 D <- DiscreteDistribution(x) ## => r, d, p and q functions (also with log-argument) r(D)(5) p(D)(4) d(D)(1) q(D)(0.3) Best, Matthias roger koenker wrote: Sure, but it would be more 'fun' to modify ecdf() slightly to produce an e

Re: [R] Function to Check Object's Memory Size

2009-01-06 Thread Gerrit Eichner
On Wed, 7 Jan 2009, Gundala Viswanath wrote: Dear all, Does R has any function that measures how much memory hold by any particular object? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

[R] Function to Check Object's Memory Size

2009-01-06 Thread Gundala Viswanath
Dear all, Does R has any function that measures how much memory hold by any particular object? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

[R] Residual deviance (cross-post from sci.stat.consult)

2009-01-06 Thread Serebrenik, A.
Dear all, I'm trying to fit a statistical model to series of measurements. Unfortunately, my knowledge of statistics is rather limited, so I'm a bit at loss of what is going on with the model. First of all, I've prepared a histogram. Then, I've tried to fit a Poisson model to express the relatio

[R] Manipulating plots

2009-01-06 Thread Benjamin Modra
Hi all, Is it possible to manipulate the properties of an active graph? I'm trying to manipulate the plots generated by extRemes into something suitable for a report, but the only change I can make successfully is add lines ( abline(v=2) ). For example, I'd like to be able to use standard ins

Re: [R] Understanding dsyrk_ in C code

2009-01-06 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Charles C. Berry wrote: > On Wed, 7 Jan 2009, Nathan S. Watson-Haigh wrote: > > I'm trying to understand some C code in an R package I'm using. I'm address > this question here as > it's matrix algebra...and I'm no pro at that! > > the C command rea

Re: [R] Understanding dsyrk_ in C code

2009-01-06 Thread Charles C. Berry
On Wed, 7 Jan 2009, Nathan S. Watson-Haigh wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm trying to understand some C code in an R package I'm using. I'm address this question here as it's matrix algebra...and I'm no pro at that! the C command reads: double alpha = 1.0, beta = 0.0;

Re: [R] directory of files in a zip file?

2009-01-06 Thread Prof Brian Ripley
On Tue, 6 Jan 2009, Spencer Graves wrote: Hi, All: How can I get the list of files contained in a zip file? "zip.file.extract" will extract a specific 'file' from 'zipname', but how can I get the names of the files in 'zipname'? Package Rcompression will I believe allow you to do this

Re: [R] sqldf with date (class date) variables ?

2009-01-06 Thread Gabor Grothendieck
sqldf has some facilities for Date class but has no knowledge of date class. See example 7b on home page: http://sqldf.googlecode.com and here is a second example: > DF <- data.frame(D = as.Date(c("21DEC2006","15DEC2006"), "%d%b%Y")) > DF D 1 2006-12-21 2 2006-12-15 > sqldf("select * f

[R] R "Threatens" SAS According to The NYT

2009-01-06 Thread ajay ohri
On Wed, Jan 7, 2009 at 11:05 AM, ajay ohri wrote: > > FYI..not a R -Help Topic, buy I dont know which list to post discussions like > this. > Regards, > Ajay > > -- Forwarded message -- > From: ajay ohri > Date: Wed, Jan 7, 2009 at 10:46 AM > Subject: Re: R "Threatens" SAS, Acco

[R] directory of files in a zip file?

2009-01-06 Thread Spencer Graves
Hi, All: How can I get the list of files contained in a zip file? "zip.file.extract" will extract a specific 'file' from 'zipname', but how can I get the names of the files in 'zipname'? Thanks, Spencer __ R-help@r-project.org

[R] heatmap.2 and three colours for specific r anges‏

2009-01-06 Thread Daren Tan
Hi, I hope to show a heatmap with thre colours, no gradation. How to specify heatmap.2 to map "green" for values less than -1, "gray" for values between -1 and 1, and "red" for values greater than 1 ? Thanks [[alternative HTML version deleted]] __

Re: [R] Destroying Attributes of a Matrix

2009-01-06 Thread Erik Iverson
In this case, how about? dimnames(mdat) <- NULL Gundala Viswanath wrote: Dear all, I have the following structure of a matrix str(mdat) num [1:32268, 1:10] 0 0 0 0 0 0 0 0 0 0 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : NULL How can I destroy the attributes such that it simp

Re: [R] Bar Plot with Connected Points on 1 Y-Axis

2009-01-06 Thread Marc Schwartz
on 01/06/2009 09:07 PM jimdare wrote: > Hi Everyone, > > Have created a bar plot of the data below using the following code: > barplot(TACC,space=0,names.arg=Year). I now want to add a series of > connected points to represent the catch. I tried to do this using > line(Catch) or points(Catch), h

[R] Destroying Attributes of a Matrix

2009-01-06 Thread Gundala Viswanath
Dear all, I have the following structure of a matrix > str(mdat) num [1:32268, 1:10] 0 0 0 0 0 0 0 0 0 0 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : NULL How can I destroy the attributes such that it simply gives: > str(mdat) num [1:32268, 1:10] 0 0 0 0 0 0 0 0 0 0 ... - Gundal

[R] Bar Plot with Connected Points on 1 Y-Axis

2009-01-06 Thread jimdare
Hi Everyone, Have created a bar plot of the data below using the following code: barplot(TACC,space=0,names.arg=Year). I now want to add a series of connected points to represent the catch. I tried to do this using line(Catch) or points(Catch), however both of these commands result in each data

Re: [R] Contributed Documentation

2009-01-06 Thread stephen sefick
I would too. On Tue, Jan 6, 2009 at 8:17 PM, Ben Bolker wrote: > Christophe Genolini u-paris10.fr> writes: > >> >> Hi the list, >> >> I wrote a tutorial about S4. Is it possible to have a link to it in the >> page "Contributed Documentation" or "R Documentation" on the CRAN web >> site ? Who sha

[R] Understanding dsyrk_ in C code

2009-01-06 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm trying to understand some C code in an R package I'm using. I'm address this question here as it's matrix algebra...and I'm no pro at that! the C command reads: double alpha = 1.0, beta = 0.0; dsyrk_("L", "N", nGenes, nGenes, & alpha, mat1, nGen

Re: [R] breaking a loop in R

2009-01-06 Thread Stavros Macrakis
? `break` On Tue, Jan 6, 2009 at 7:58 PM, kayj wrote: > I was wondering if there is anything that breaks a loop in R > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Converting data frame to symmetric matrix

2009-01-06 Thread jim holtman
try this: L3 <- LETTERS[1:3] x=c(1,1,2,2,3,3,4,4,5,5) y=1:10 d <- data.frame(cbind(x,y), fac=I(sample(L3, 10, replace=TRUE))) m.out <- matrix(ncol=10, nrow=10) m.out[cbind(d$x, d$y)] <- d$fac On Tue, Jan 6, 2009 at 3:29 AM, wrote: > Dear Sir or Madam, > > I have the following data frame (which

Re: [R] Memory Efficiency of Symmetric Matrix

2009-01-06 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 andrew wrote: > the SparseM package might be what you are looking for > > http://www.econ.uiuc.edu/~roger/research/sparse/SparseM.pdf > > On Jan 7, 11:36 am, Søren Højsgaard wrote: >> You can do >> mat[lower.tri(mat, diag=F)] >> Søren >> Thanks, al

Re: [R] breaking a loop in R

2009-01-06 Thread jim holtman
something like this should do it: breakFlag <- FALSE For (k in 1:100) For ( i in 1:10){ If ( condition ){ breakFlag <- TRUE break } } if (breakFlag) break } On Tue, Jan 6, 2009 at 7:58 PM, kayj wrote: > > Hi All, > > I was wondering if there

[R] breaking a loop in R

2009-01-06 Thread kayj
Hi All, I was wondering if there is anything that breaks a loop in R. For example, For (k in 1:100) For ( i in 1:10){ If ( condition ){ Break the inner loop } } } In the above case, if the program runs the if statement, then I want the inner loop for (i in 1:10) to stop looping and skip t

Re: [R] RODBC connection die - using more than 1 Rgui/Rcmdr

2009-01-06 Thread jaey.ahn
First of all, I apologize for misleading you by mentioning irrelevant error message. Forget about the error message I stated in the first place. I should have clearly stated in the first place. No error message was shown at the moment of the problem. Without any warnings and error message shown, m

Re: [R] Memory Efficiency of Symmetric Matrix

2009-01-06 Thread andrew
the SparseM package might be what you are looking for http://www.econ.uiuc.edu/~roger/research/sparse/SparseM.pdf On Jan 7, 11:36 am, Søren Højsgaard wrote: > You can do > mat[lower.tri(mat, diag=F)] > Søren > > > > Fra: r-help-boun...@r-project.org på vegne af N

Re: [R] Generating GUI for r-scripts

2009-01-06 Thread Michael Bibo
Daren Tan hotmail.com> writes: > I have developed some scripts that basically ask for input tab-limited format files, do some processing, > and output several pictures or csv. Now I need to have some gui to wrap on top of the scripts, so that > end-users can select their input files, adjust s

Re: [R] Memory Efficiency of Symmetric Matrix

2009-01-06 Thread Steven McKinney
See also the dist() function documentation. If you use indexing as described in ?dist it is straightforward to maintain and use a vector of the distances. Steven McKinney Statistician Molecular Oncology and Breast Cancer Program British Columbia Cancer Research Centre email: smckinney +at+ bccrc

Re: [R] Contributed Documentation

2009-01-06 Thread Ben Bolker
Christophe Genolini u-paris10.fr> writes: > > Hi the list, > > I wrote a tutorial about S4. Is it possible to have a link to it in the > page "Contributed Documentation" or "R Documentation" on the CRAN web > site ? Who shall I contact ? > > Christophe Try c...@r-project.org . Posting to

[R] How-To extract data from a matrix of lists subject to a set of given constraints

2009-01-06 Thread mauede
My goal is to store the DWT coefficients from a number of time series in such a way to be able to extract subsets satisfying giben conditions. I have defined the following 11 matrices whose x-axis represent time intervals and y-axis represent the number of time series: MS <- 11 d1.mat <-

Re: [R] Memory Efficiency of Symmetric Matrix

2009-01-06 Thread Søren Højsgaard
You can do mat[lower.tri(mat, diag=F)] Søren Fra: r-help-boun...@r-project.org på vegne af Nathan S. Watson-Haigh Sendt: on 07-01-2009 01:28 Til: r-help@r-project.org Emne: [R] Memory Efficiency of Symmetric Matrix -BEGIN PGP SIGNED MESSAGE- Hash: SHA

Re: [R] Social Networks - how to get the same network layout every time when I plot the network?

2009-01-06 Thread jim holtman
If you want the same network each time, then set the random seed to the same value: n<-6 dat <- rbinom(n*(n-1)/2,1,.6) net<-diag(n) net[lower.tri(net)] <- dat net[upper.tri(net)] <- t( net )[upper.tri(net)] net #the network library(network) g<-network(net,directed=FALSE) set.seed(1) plot.network(g

[R] Memory Efficiency of Symmetric Matrix

2009-01-06 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm generating a symmetric correlation matrix using a data matrix as input: mat <- cor(data.mat) My question is: Is there a more memory efficient way to store this data? For instance, since: all(mat == t(mat)) every value is duplicated, and I should b

Re: [R] Drawing from an empirical distribution

2009-01-06 Thread roger koenker
Nit-picking about syntax does seem needed, mea culpa, I intended something more like: Qn <- ecqf(x) Qn(runif(whatever)) On Jan 6, 2009, at 5:06 PM, roger koenker wrote: Sure, but it would be more 'fun' to modify ecdf() slightly to produce an ecqf() function -- essentially rev

Re: [R] Drawing from an empirical distribution

2009-01-06 Thread roger koenker
Sure, but it would be more 'fun' to modify ecdf() slightly to produce an ecqf() function -- essentially reversing the arguments to approxfun()-- and then use ecqf(runif(whatever)) no nit-picking about efficiency, please. url:www.econ.uiuc.edu/~rogerRoger Koenker ema

Re: [R] Drawing from an empirical distribution

2009-01-06 Thread culpritNr1
Thank you. That's exactly what I was looking for. Antonio, Fabio Di Narzo wrote: > > If the ecdf is 'ecdf(x)', do just: >> sample(x, size=whatever, replace=TRUE) > > HTH, > Antonio. > > 2009/1/6 culpritNr1 : >> >> Hi All, >> >> Does anybody know if there is a simple way to draw numbers from

Re: [R] Drawing from an empirical distribution

2009-01-06 Thread Albyn Jones
the empirical distribution gives probability 1/n to each of n observations. rather than sampling the unit interval, just resample the dataset. If x is your dataset, and you want an independent sample of size k, sample(x,size=k,replace=TRUE) albyn On Tue, Jan 06, 2009 at 02:39:17PM -0800,

Re: [R] Drawing from an empirical distribution

2009-01-06 Thread Antonio, Fabio Di Narzo
If the ecdf is 'ecdf(x)', do just: > sample(x, size=whatever, replace=TRUE) HTH, Antonio. 2009/1/6 culpritNr1 : > > Hi All, > > Does anybody know if there is a simple way to draw numbers from an empirical > distribution? > > I know that I can plot the empirical cumulative distribution function th

[R] Drawing from an empirical distribution

2009-01-06 Thread culpritNr1
Hi All, Does anybody know if there is a simple way to draw numbers from an empirical distribution? I know that I can plot the empirical cumulative distribution function this easy: plot(ecdf(x)) Now I want to pick a number between 0 and 1 and go back to domain of x. Sounds simple to me. Any sug

[R] Social Networks - how to get the same network layout every time when I plot the network?

2009-01-06 Thread Despina Stefan
Hi, I am using the function plot.network from the network library. However, I noticed that every time when I use the function I get a different layout (the network is rotated?). I would like to get the exact same picture every time when I use the function. Is that possible (maybe set a seed or s

Re: [R] R SEM package

2009-01-06 Thread John Fox
Dear Anthony, As I said, the sem package won't do multiple-group analysis. I would like at some point to add multiple-group analysis to the capabilities of the package but I can't say when I might find time to do that. Sorry, John -- John Fox, Professor Department of

[R] Contributed Documentation

2009-01-06 Thread Christophe Genolini
Hi the list, I wrote a tutorial about S4. Is it possible to have a link to it in the page "Contributed Documentation" or "R Documentation" on the CRAN web site ? Who shall I contact ? Christophe __ R-help@r-project.org mailing list https://stat.eth

Re: [R] R SEM package

2009-01-06 Thread Anthony Dick
Hi John- Thanks for responding so quickly. Love the package by the way. I am using R sem to model fMRI data, and I want to compare models between conditions (i.e., to see if there is a significant difference between specific path coefficients of two models). I believe this amounts to what is

Re: [R] Using apply for two datasets

2009-01-06 Thread Gang Chen
Thanks a lot for the suggestions, Jorge and Satoshi Takahama! Both approaches work well... Gang On Tue, Jan 6, 2009 at 2:12 PM, Satoshi Takahama wrote: > Perhaps you can convert your matrices to data frames as in: > > mapply(t.test,as.data.frame(myData1),as.data.frame(myData2)) > to test by colu

Re: [R] Overlaying several qqnorm curves in same frame

2009-01-06 Thread Deepayan Sarkar
On 1/6/09, Assaf oron wrote: > Hi all, > > I want to create a rather standard overlaid qqnorm plot on a single > variable, with different subgroups of the same dataset plotted using > different colors/symbols/etc. (I don't want side-by-side, rather > different-colored curves on the same graph)

Re: [R] R SEM package

2009-01-06 Thread John Fox
Dear Anthony, I'm not sure what you mean by a "stacked model comparison." If you mean a model fit to multiple groups, then the answer is no. If you mean comparison of nested models, then anova() can be used to get a LR test. See ?anova.sem. I hope this helps, John --

[R] Overlaying several qqnorm curves in same frame

2009-01-06 Thread Assaf oron
Hi all, I want to create a rather standard overlaid qqnorm plot on a single variable, with different subgroups of the same dataset plotted using different colors/symbols/etc. (I don't want side-by-side, rather different-colored curves on the same graph) I managed to do it rather tediously using "

[R] R SEM package

2009-01-06 Thread Anthony Dick
Does anyone know if the sem package in R can implement a stacked model comparison, for example as in LISREL or AMOS? Thanks, Anthony -- Anthony Steven Dick, Ph.D. Post-Doctoral Fellow Human Neuroscience Laboratory Department of Neurology The University of Chicago 5841 S. Maryland Ave. MC-2030

Re: [R] Using apply for two datasets

2009-01-06 Thread Satoshi Takahama
Perhaps you can convert your matrices to data frames as in: mapply(t.test,as.data.frame(myData1),as.data.frame(myData2)) to test by column and mapply(t.test,as.data.frame(t(myData1)),as.data.frame(t(myData2))) to test by row? - Original Message From: Gang Chen To: Henrique Dallazuan

Re: [R] Two Noobie questions

2009-01-06 Thread AllenL
Thanks for your help! I combined the above two to get the following, which seems to work (if somewhat inelegant): int.List<-unlist(lapply(lmList, function(x) {coef(x)[1]}),use.names=FALSE) lmList is my list of lm objects. -Allen David Winsemius wrote: > > > On Jan 6, 2009, at 1:50 PM, Al

Re: [R] for loop and if problem

2009-01-06 Thread Charles C. Berry
On Tue, 6 Jan 2009, Sake wrote: Hi, I'm heaving difficulties with a dataset containing gene names and positions of those genes. Not such a big problem, but each gene has multiple exons so it's hard to say where de gene starts and where it ends. I want the starting and ending position of each g

[R] sqldf with date (class date) variables ?

2009-01-06 Thread si.fu
Hello, I am having trouble with retrieving some data in queries involve with variables with data type "date". See the enclosed example: ll<-c("21DEC2006","15DEC2006") ss<-data.frame(ll) ss<-transform(ss,ll=as.date(as.character(ll))) (ss) ll 1 17156 2 17150 tt<-sqldf("select ll from ss") (t

Re: [R] Alternate looping

2009-01-06 Thread Patrick Connolly
On Tue, 06-Jan-2009 at 04:27PM +, Luis Ridao Cruz wrote: |> R-help, |> |> I'm using the "for" control flow to graph plots continuously: |> |> par(mfrow=c(3,5), mar=c(0.6,.2,1.2,.2),yaxt="n",xaxt="n") |> for(j in 1:11) |> { |> for(i in 1:15) |> { |> |> species <- spAldur[spAldur$ar ==

Re: [R] Two Noobie questions

2009-01-06 Thread David Winsemius
On Jan 6, 2009, at 1:50 PM, AllenL wrote: 1. I have a list of lm (linear model) objects. Is it possible to select, through subscripts, a particular element (say, the intercept) from all the models? I've tried something like this: ?coef if your list of models is ml, then perhaps somethin

[R] Two Noobie questions

2009-01-06 Thread AllenL
1. I have a list of lm (linear model) objects. Is it possible to select, through subscripts, a particular element (say, the intercept) from all the models? I've tried something like this: List[[1:length(list)]][1] All members of the list are similar. My goal is to have a list of the intercepts an

Re: [R] history: recording

2009-01-06 Thread Prof Brian Ripley
On Tue, 6 Jan 2009, Troels Ring wrote: Thanks a lot - windows(record=TRUE) seems to do the job. If you want to control an already open graphics device you will need the R-devel version, which has a function msgWindow() to change a lot of settings, including 'record'. Sorry not to have fo

Re: [R] Using apply for two datasets

2009-01-06 Thread Jorge Ivan Velez
Hi Gang, Perhaps this post might be useful in this case. Please take a special lookat Gábor Csárdi's reply. http://www.nabble.com/apply,-t-test-and-p-values-to20012292.html#a20012292 HTH, Jorge On Tue, Jan 6, 2009 at 1:10 PM, Gang Chen wrote: > Thanks a lot for the quick help! > > mapply() s

[R] Duplicated messages

2009-01-06 Thread Bert Gunter
Folks: I am getting duplicate messages on posts. Please correct my details if I'm wrong, but I believe it's because folks are posting to **both** the addresses, r-help@r-project.org and r-h...@stat.math.eth.ch . I believe the first is just an alias for the second, and that's why the suplicate po

Re: [R] Using apply for two datasets

2009-01-06 Thread Gang Chen
Thanks a lot for the quick help! mapply() seems promising. However, mapply(t.test, myData1, myData2) would not work, so how can I specify the margin in mapply() which function t.test() will be applied over? For example, I specify the 2nd dimension (column) in apply(myData1, 2, t.test) to run one-s

Re: [R] Large Dataset

2009-01-06 Thread Edwin Sendjaja
Bellow, you can see the R data. But this stucks even in first line (read.table..). I dont know how to calculate this and write the result into a new table. Edwin data <- read.table("test.data") data <- subset(data, (data$Zusatz!="60") & (data$Zusatz!="0")) list(EndpointKeepAliveTim

Re: [R] Using apply for two datasets

2009-01-06 Thread Henrique Dallazuanna
I think that you can use mapply for this. On Tue, Jan 6, 2009 at 3:24 PM, Gang Chen wrote: > I can run one-sample t-test on an array, for example a matrix myData1, > with the following > > apply(myData1, 2, t.test) > > Is there a similar fashion using apply() or something else to run > 2-sample

[R] Using apply for two datasets

2009-01-06 Thread Gang Chen
I can run one-sample t-test on an array, for example a matrix myData1, with the following apply(myData1, 2, t.test) Is there a similar fashion using apply() or something else to run 2-sample t-test with datasets from two groups, myData1 and myData2, without looping? TIA, Gang __

Re: [R] Large Dataset

2009-01-06 Thread Simon Pickett
Increase the memory as much as you can, read in the data, (however long it takes) then aggregate the data into smaller chunks, selecting only the bits you want. Remove the big original data set from memory (using rm()) and keep (or save the smaller aggregated data using wite.table()) If this

Re: [R] Large Dataset

2009-01-06 Thread Gábor Csárdi
For the mean, min, max and standard deviance (deviation I suppose) you don't need to store all data in the memory, you can calculate them incrementally. Read the file line by line (if it is a text file). G. On Tue, Jan 6, 2009 at 6:10 PM, Edwin Sendjaja wrote: > Hi Ben, > > Using colClasses doen

Re: [R] Large Dataset

2009-01-06 Thread Gabor Grothendieck
The sqldf R package can import a file into an sqlite database and extract a portion of it. You basically need two statements: one to specify the name and format of the file and one to specify what you want to extract. See home page at: http://sqldf.googlecode.com On Tue, Jan 6, 2009 at 12:10 PM,

Re: [R] Large Dataset

2009-01-06 Thread Edwin Sendjaja
Hi Ben, Using colClasses doensnt improve the performace much. With the data, I will calculate the mean, min, max, and standard deviance. I have also failed to import the data in a Mysql Database. I dont have much knowledge in Mysql. Edwin > Edwin Sendjaja web.de> writes: > > Hi Simon, > >

Re: [R] the first and last observation for each subject

2009-01-06 Thread William Dunlap
Just in case anyone is still interested, here are some comparisons of the time it says to compute grouped medians via sapply(split(x,group),median) and gm(x,group), which uses the trick used by rle() to find the first and last entries in each group. Which method is fastest depends on the nature of

Re: [R] Large Dataset

2009-01-06 Thread Edwin Sendjaja
Hi Simons, Is SAS more powerfull than R? Well, I think I cannot afford to buy SAS. actually, my computer isn't really slow. I think 4GB RAM is big enough for personal PC. I am just wondering, why R running so slow with these specs to handling 3 GB data set. What if the data set were 1 TB?mm

[R] Singularity of lda function in MASS package

2009-01-06 Thread Mizanur Khondoker
I have two specific questions regarding the output of lda function in MASS. #Question1: #= n: sample size, p: number of variables Some articles in the literature say that LDA is singular for p > n-1. However, my experimentation with lda (default arguments) for two class problems shows c

Re: [R] history: recording

2009-01-06 Thread Troels Ring
Thanks a lot - windows(record=TRUE) seems to do the job. Sorry not to have found it. Troels jim holtman skrev: ?windows On Tue, Jan 6, 2009 at 10:44 AM, Troels Ring wrote: Hi, I'm using windows xp and R 2.8.0 - I wonder what is the command to put in a script that has the same effect as whe

[R] smoothed contour lines

2009-01-06 Thread Andrea Storto
Hi all, I'm trying to draw a contour plot with rounded (smoothed) contour lines instead of sharp angles; when the grid consists of only a few points in x- and y- axis, the resulting contour is in facts rather ugly since very sharp angles may appear. I did not find any way to do it, by using eith

Re: [R] Sweave in LATEX

2009-01-06 Thread Gabor Grothendieck
Another thing to try is placing Sweave.sty in the same directory as your .Rnw file and experiment with and without \usepackage{Sweave} in your .Rnw file. On Tue, Jan 6, 2009 at 11:39 AM, Duncan Murdoch wrote: > Your example works for me. I'd guess there's a problem with the way you > handled S

Re: [R] history: recording

2009-01-06 Thread jim holtman
?windows On Tue, Jan 6, 2009 at 10:44 AM, Troels Ring wrote: > Hi, I'm using windows xp and R 2.8.0 - I wonder what is the command to put > in a script that has the same effect as when in a plot you choose menu > "History" and "Recording". > Best wishes > Troels > > -- > > Troels Ring - - > Depar

Re: [R] Sweave in LATEX

2009-01-06 Thread Duncan Murdoch
One other suggestion: use the SweavePDFMikTex function from patchDVI (available on http://r-forge.r-project.org/projects/sweavesearch) to handle both the Sweave call, and the pdflatex call. Duncan Murdoch __ R-help@r-project.org mailing list https:/

Re: [R] Large Dataset

2009-01-06 Thread Simon Pickett
Hi, I am not very knowledgeable about this kind of stuff but my guess is that if you have a fairly slow computer and massive data sets there isnt alot you can do except get a better computer, buy more RAM or use something like SAS instead? Hopefully someone else will chip in Edwin, best of l

Re: [R] Interval censored Data in survreg() with zero values!

2009-01-06 Thread Geraldine Henningsen
Terry Therneau schrieb: > Apologies -- you are being more subtle than I thought. Nevertheless, I think > that the censoring language isn't quite right. > > You are thinking of a hierarchical model: > > z ~ N(Xb, sigma), where Xb is the linear predictor, whatever covariates > you > thin

Re: [R] Sweave in LATEX

2009-01-06 Thread Duncan Murdoch
Your example works for me. I'd guess there's a problem with the way you handled Sweave.sty, but I don't really know what it would be. Can't you tell MikTex to use the Sweave file from its original location, using -include_directory? Duncan Murdoch On 1/6/2009 10:48 AM, Mr Derik wrote: Than

Re: [R] for loop and if problem

2009-01-06 Thread Philipp Pagel
On Tue, Jan 06, 2009 at 07:21:48AM -0800, Sake wrote: > I'm heaving difficulties with a dataset containing gene names and positions > of those genes. > Not such a big problem, but each gene has multiple exons so it's hard to say > where de gene starts and where it ends. I want the starting and endi

Re: [R] for loop and if problem

2009-01-06 Thread Richard . Cotton
> I'm heaving difficulties with a dataset containing gene names and positions > of those genes. > Not such a big problem, but each gene has multiple exons so it's hard to say > where de gene starts and where it ends. I want the starting and ending > position of each gene in my dataset. > Attached

[R] Alternate looping

2009-01-06 Thread Luis Ridao Cruz
R-help, I'm using the "for" control flow to graph plots continuously: par(mfrow=c(3,5), mar=c(0.6,.2,1.2,.2),yaxt="n",xaxt="n") for(j in 1:11) { for(i in 1:15) { species <- spAldur[spAldur$ar == 1993+i & spAldur$aldur == j,] plot(spec...@coords[,1], spec...@coords[,2], xlim=c(-10,-3.5),

[R] Semi-definite quadratic programming

2009-01-06 Thread Kyle Abbott
Hi, I am currently using solve.QP from the quadprog package to solve some quadratic optimization problems of the form: min[ -d'b + (1/2) b'Db ] under constraints A'b >= b_0 solve.QP appears to use an implementation of the Goldfarb and Idnani algorithm. I now have a problem of this form where the

Re: [R] R Stacked Histogram

2009-01-06 Thread ONKELINX, Thierry
Dear Jason, Have a look at scale_y_continuous() and scale_fill_discrete(). This might work (untested as your example is not reproducible with a (dummy) dataset). qplot(Age, data = recerts_combined_values, binwidth = 5, fill = combined_values$Test.Type, main="Combined Age Histogram") + scale_x_

Re: [R] Sweave in LATEX

2009-01-06 Thread Mr Derik
Thanks for replying. I'm working on a windows XP sp3 PC. I am trying to run the test file provided by R at the moment: % -*- mode: noweb; noweb-default-code-mode: R-mode; -*- \documentclass[a4paper]{article} \title{A Test File}

[R] history: recording

2009-01-06 Thread Troels Ring
Hi, I'm using windows xp and R 2.8.0 - I wonder what is the command to put in a script that has the same effect as when in a plot you choose menu "History" and "Recording". Best wishes Troels -- Troels Ring - - Department of nephrology - - Aalborg Hospital 9100 Aalborg, Denmark - - +45 99326

Re: [R] Error : unused arguments in pairs()

2009-01-06 Thread herwig
Dear Sarah, Thank you a lot, It does exactly what I need. By the way, I tried doing what Prof. Ripley suggested I just was not able to get it right - I am pretty new to this after all. Thank again, Herwig Sarah Goslee wrote: > > You didn't do what Prof. Ripley suggested - adding a ... argumen

[R] for loop and if problem

2009-01-06 Thread Sake
Hi, I'm heaving difficulties with a dataset containing gene names and positions of those genes. Not such a big problem, but each gene has multiple exons so it's hard to say where de gene starts and where it ends. I want the starting and ending position of each gene in my dataset. Attached is the

[R] Generating GUI for r-scripts

2009-01-06 Thread Daren Tan
Hi, I have developed some scripts that basically ask for input tab-limited format files, do some processing, and output several pictures or csv. Now I need to have some gui to wrap on top of the scripts, so that end-users can select their input files, adjust some parameters for processing, a

Re: [R] R Stacked Histogram

2009-01-06 Thread Jason Rupert
Great advice.  I did a quick read and came up with the following:   qplot(Age, data = recerts_combined_values, binwidth = 5, fill = combined_values$Test.Type, ylab="Counts", xlab="Age, months",  main="Combined Age Histogram", legend.name = "Type of Tests") U

Re: [R] Large Dataset

2009-01-06 Thread Ben Bolker
Edwin Sendjaja web.de> writes: > > Hi Simon, > > My RAM is only 3.2 GB (actually it should be 4 GB, but my Motherboard doesnt > support it. > > R use almost of all my RAM and half of my swap. I think memory.limit will not > solve my problem. It seems that I need RAM. > > Unfortunately, I

Re: [R] Error : unused arguments in pairs()

2009-01-06 Thread Sarah Goslee
You didn't do what Prof. Ripley suggested - adding a ... argument. Here's a crude version of what you want; I'm sure there's a more elegant solution for passing the needed data to the panel function. panel.cor <- function(x, y, digits=2, prefix="", splitvar, col.cor, ...) { usr <- par("usr");

Re: [R] Large Dataset

2009-01-06 Thread Edwin Sendjaja
Hi Simon, My RAM is only 3.2 GB (actually it should be 4 GB, but my Motherboard doesnt support it. R use almost of all my RAM and half of my swap. I think memory.limit will not solve my problem. It seems that I need RAM. Unfortunately, I can't buy more RAM. Why R is slow reading big data se

Re: [R] Selecting variables from a list of data.frames

2009-01-06 Thread Ben Bolker
Magnus zulutime.net> writes: > > I have a simulation program that generates a data frame for each run. I > aggregate the data.frames into a list (df.list). The structure of all data > frames is the same, only the values are different. > > I then want to aggregate the various runs. Currently

Re: [R] Sweave in LATEX

2009-01-06 Thread Duncan Murdoch
On 1/6/2009 6:44 AM, Mr Derik wrote: Hello I have been setting up my computer to run Sweave. I have got the whole thing working on example files, except that my MikTex returns an "Undefined Control Sequence" error for \Sexpr and my output file contains verbatim code sequences at the apropriate p

Re: [R] Large Dataset

2009-01-06 Thread Simon Pickett
Yup, it was a typo. But I always try capital if lower case doesnt work, Sorry. - Original Message - From: "David Winsemius" To: "Simon Pickett" Cc: "Edwin Sendjaja" ; Sent: Tuesday, January 06, 2009 12:40 PM Subject: Re: [R] Large Dataset When I do it on a Mac installation I ge

Re: [R] Changing Matrix Header

2009-01-06 Thread Henrique Dallazuanna
Try this: unname(dat) On Tue, Jan 6, 2009 at 6:14 AM, Gundala Viswanath wrote: > Dear all, > > I have the following matrix. > > > dat > A A A A A A A A A A >[1,] 0 0 0 0 0 0 0 0 0 0 >[2,] 0 0 0 0 0 0 0 0 0 1 >[3,] 0 0 0 0 0 0 0 0 0 2 > > How can I change it into: > [,

Re: [R] Large Dataset

2009-01-06 Thread Simon Pickett
Only a couple of weeks ago I had to deal with this. adjust the memory limit as follows, although you might not want 4000, that is quite high memory.limit(size = 4000) Simon. - Original Message - From: "Edwin Sendjaja" To: "Simon Pickett" Cc: Sent: Tuesday, January 06, 2009 1

[R] Selecting variables from a list of data.frames

2009-01-06 Thread Magnus
I have a simulation program that generates a data frame for each run. I aggregate the data.frames into a list (df.list). The structure of all data frames is the same, only the values are different. I then want to aggregate the various runs. Currently I use the following method (for three runs

Re: [R] Changing Matrix Header

2009-01-06 Thread Jorge Ivan Velez
Dear Gundala, Try this: # Original matrix set.seed(123) X=matrix(rnorm(100),ncol=10) colnames(X)<-paste('X',1:10,sep="") X # No headers colnames(X)<-NULL X HTH, Jorge On Tue, Jan 6, 2009 at 3:14 AM, Gundala Viswanath wrote: > Dear all, > > I have the following matrix. > > > dat > A A

[R] Can't i provide variables for the select clause of the subset function?

2009-01-06 Thread Moumita Das
Hi guys, Have done something like this:--- #Looping through each set of elements of the correlation cross product combinations and collecting datatsets for those elements for(corr_combs_counter in 1:1) { rowval_corr_combs<-corr_c

[R] Sweave in LATEX

2009-01-06 Thread Mr Derik
Hello I have been setting up my computer to run Sweave. I have got the whole thing working on example files, except that my MikTex returns an "Undefined Control Sequence" error for \Sexpr and my output file contains verbatim code sequences at the apropriate point in the text rather than the R out

Re: [R] adding a curve with xaxs="i"

2009-01-06 Thread Peter Dalgaard
Valentina Kraus wrote: > Unfortunately, I need add=T because there are many other things in the graph. > > I could swear that it worked 2 years ago. It can't have worked. Axis settings are fixed before you start adding things. Presumably you used xlim, xaxs et al. on one of the previous commands

  1   2   >