Re: [R] Rprintf and C stack usage is too close to the limit

2008-06-13 Thread Prof Brian Ripley
Rprintf is the right function, but this is the wrong list (please see the posting guide). The issue is related to your 'C++ program', not to R itself and we have no details. Non-R programming questions should go to R-devel, as the posting guide says. On Thu, 12 Jun 2008, Youyi Fong wrote:

Re: [R] Regex for Special Characters under Grep

2008-06-13 Thread Prof Brian Ripley
On Thu, 12 Jun 2008, Henrik Bengtsson wrote: A regular set is given by [set]. The complementary set is given by [^set] where set is a set of symbols. I don't think you have to escape symbols in set (but I might be wrong). This covered in ?regexp. The metacharacters in character classes

Re: [R] Getting Batch mode to continue running a script after running into errors

2008-06-13 Thread Prof Brian Ripley
?stop explains why this happens and how to change it. You can also set options(error=expression(NULL)) to ignore all errors, and use tryCatch() (or its wrapper try()) skip particular expressions if tjhey fail. But surely in your example your script should check for existence of the file by

Re: [R] x86 SSE* Pointer Favors

2008-06-13 Thread Ivan Adzhubey
Hi Ivo, On Friday 13 June 2008 12:23:06 am ivo welch wrote: Dear Statisticians--- This is not even an R question, so please forgive me. I have so much ignorance in this matter that I do not know where to begin. I hope someone can point me to documentation and/or a sample. You will sure

Re: [R] x86 SSE* Pointer Favors

2008-06-13 Thread Prof Brian Ripley
Let me pick up on Enabling SSE instructions in addition while building R (yes, you have to enable them explicitly, see man gcc) is possible but does not help much since all maths is mostly done in BLAS. The final part is not true for my 'maths', only for those doing linear algebra.

Re: [R] Problem with rowMeans()

2008-06-13 Thread Wacek Kusnierczyk
Erik Iverson wrote: ss wrote: It is: data - read.table('E-TABM-1-processed-data-1342561271_log2_with_symbols.txt', row.names = NULL ,header=TRUE, fill=TRUE) class(data[3]) [1] data.frame Oops, should have said class(data[[3]]) and is.numeric(data[[3]]) oops, my typo. of

[R] parsing - input buffer overflow

2008-06-13 Thread Daniel Malter
Hi, I am trying to parse a large amount of text using gregexpr(). Unfortunately, I get an input buffer overflow message when I attempt that with too large an amount of text. The error messages occurs before the parsing. The problem is that I cannot assign the text to a variable (an object) if the

[R] Sweave: looping over mixed R/LaTeX code

2008-06-13 Thread Stephan Kolassa
Dear guRus, I would like to loop over a medium amount of Sweave code, including both R and LaTeX chunks. Is there any way to do so? As an illustration, can I create a .tex file like this using a loop within a .Rnw file, where the 1,2,3 comes from some iteration variable in R?

[R] adding custom axis to image.plot() and strange clipping behavior

2008-06-13 Thread Stephen Tucker
Hi list, I wanted to plot an image with a colorbar to the right of the plot, but set my own axis labels (text rather than numbers) to the image. I have previously accomplished this with two calls to image(), but the package 'fields' has a wrapper function, image.plot(), which does this task

Re: [R] Sweave: looping over mixed R/LaTeX code

2008-06-13 Thread Delphine Fontaine
Dear Stephan, I have the same problem than you. My solution is a bit different but not very elegant I have a master document (let say master.Snw) and a file containing the code to repeat (which would be in the loop). In the master document I start a counter at 0, and I copy

[R] Looping, Control Flow Conditional Statements

2008-06-13 Thread Garth.Warren
Dear R Group: I have little experience using R and even less experience with control flow type questions. See the following code: a1 = c(0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0) for(i in 1:1){ sx - paste(a,i,sep=) s - eval(parse(text =

Re: [R] parsing - input buffer overflow

2008-06-13 Thread Prof Brian Ripley
On Fri, 13 Jun 2008, Daniel Malter wrote: Hi, I am trying to parse a large amount of text using gregexpr(). Unfortunately, I get an input buffer overflow message when I attempt that with too large an amount of text. The error messages occurs before the parsing. The problem is that I cannot

Re: [R] How to increase the for() loop speed?

2008-06-13 Thread Karl Ove Hufthammer
Rafael Barros de Rezende: I would like to know if there is a way to increase the for() loop speed because in my routine the calculations are too slow. Read the article 'How Can I Avoid This Loop or Make It Faster?' on page 46 in the latest R News

[R] Output of silhouette (cluster package)

2008-06-13 Thread Cristiano Varin
Dear R users, I am mailing you about the graphical output of silhouette (cluster package) From the example of silhouette in help(silhouette): ar - agnes(ruspini) si3 - silhouette(cutree(ar, k = 5), # k = 4 gave the same as pam() above +daisy(ruspini)) plot(si3,

Re: [R] model simplification using Crawley as a guide

2008-06-13 Thread Jim Lemon
Peter Dalgaard wrote: ... That'll be anti-hist()-amine, I presume? I would think p-necillin a more appropriate treatment. Jim __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] uncertainty bounds for a weighted moving average

2008-06-13 Thread jgarcia
Hi, well; this is not a R-specific question. But perhaps you can help. If I've got an irregularly sampled time series, and conduct a moving average filter (e.g., with a triangular kernel), how could the uncertainty bounds be calculated? Thanks and best regards J. ---

[R] Writing a new link for a GLM.

2008-06-13 Thread Jan Graffelman
Hi, I wish to write a new link function for a GLM. R's glm routine does not supply the loglog link. I modified the make.link function adding the code: }, loglog = { linkfun - function(mu) -log(-log(mu)) linkinv - function(eta) exp(-exp(-eta)) mu.eta - function(eta)

Re: [R] adding custom axis to image.plot() and strange clipping behavior

2008-06-13 Thread Katharine Mullen
I also noticed that adding a custom axis with image.plot was a problem; you can also do: library(fields) m - matrix(1:15,ncol=3) par(mar=c(5,5,5,7)) image(m, axes=FALSE) # add axis axis(1,axTicks(1),lab=letters[1:length(axTicks(1))]) box() ## add legend image.plot(m, legend.only=TRUE)

Re: [R] Sweave: looping over mixed R/LaTeX code

2008-06-13 Thread Dieter Menne
Stephan Kolassa Stephan.Kolassa at gmx.de writes: I would like to loop over a medium amount of Sweave code, including both R and LaTeX chunks. Is there any way to do so? As an illustration, can I create a .tex file like this using a loop within a .Rnw file, where the 1,2,3 comes from some

Re: [R] MCA in R

2008-06-13 Thread John Fox
Dear Kimmo, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of K. Elo Sent: June-13-08 1:43 AM To: r-help@r-project.org Subject: Re: [R] MCA in R Dear John, thanks for Your quick reply. John Fox wrote: Dear Kimmo, MCA is a rather old

[R] Switching the order of legend boxes in a lattice bar graph

2008-06-13 Thread Bob Green
I suspect there is a simple solution to this problem, but have been unable to find it. Below is some code that I have run to create 3 lattice graphs. I have been asked to change the legend so that the 'No' and dark blue are above Y and light blue in the legend to mirror the stacked bars in

Re: [R] Switching the order of legend boxes in a lattice bar graph

2008-06-13 Thread Markus Gesmann
Hi Bob, Would this: mykey - list( rectangles = list(col=c(dark blue,light blue) ), text=list(lab=c(No,Yes)),x = .6, y = .7, corner = c(0, 0)) barchart(Freq ~ Status | which, groups=group, data=stuff, stack=TRUE, as.table=TRUE, layout=c(2,2),

Re: [R] Writing a new link for a GLM.

2008-06-13 Thread roger koenker
I wrote an R-news note about this sort of thing in 2006, you can navigate there via CRAN... url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678

[R] R and Browninan Motion/ Langevin Equation package

2008-06-13 Thread Peter Mueller
Hi, I'm writing a short course tutorial to Browninan Motion/ Langevin Equation. At the end of the theory section I wanted to add a short GNU R example, so the students can play a little around. I already looked in the MASS book (by Venables and Ripley) but I couldn't find any Brownian Motion/

Re: [R] MCA in R

2008-06-13 Thread Prof Brian Ripley
Although John Fox naturally mentions his Anova function, I would like to point out that drop1() (and MASS::dropterm) also does the tests of Type-II ANOVA of which John says 'more tediously do these tests directly'. It seems a lot easier to teach newcomers about drop1() than to introduce the

Re: [R] MCA in R

2008-06-13 Thread John Fox
Dear Brian, -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: June-13-08 8:13 AM To: John Fox Cc: 'K. Elo'; r-help@r-project.org Subject: Re: [R] MCA in R Although John Fox naturally mentions his Anova function, I would like to point out that drop1()

Re: [R] Problems with mars in R in the case of nonlinear functions

2008-06-13 Thread Stephen Milborrow
| I'm trying to use mars function in R to interpolate nonlinear | multivariate functions. | However, it seems that mars gives me a fit which uses only very few | basis function and it underfits very badly. Try the earth package which extends the mars function in the mda package. Your example

Re: [R] R and Browninan Motion/ Langevin Equation package

2008-06-13 Thread jim holtman
Google R and Browninan Motion.. It turned up this link: http://landshape.org/enm/r-code-for-brownian-motion/ Mybe this will help. On Fri, Jun 13, 2008 at 8:08 AM, Peter Mueller [EMAIL PROTECTED] wrote: Hi, I'm writing a short course tutorial to Browninan Motion/ Langevin Equation. At the end

Re: [R] piper diagram

2008-06-13 Thread stephen sefick
RSEIS - I think may have a piper diagram. On Thu, Jun 12, 2008 at 8:39 PM, Michael Grant [EMAIL PROTECTED] wrote: Sorry no previous message text or addresses, but I just cleaned my mailbox and then found something relevant. Regarding the Piper diagram. I just noticed the 'hydrogeo' package

[R] C# and R

2008-06-13 Thread Neil Gupta
Hello R-Users, I came across this link on CodeProject.com and was wondering, if anyone has implemented this and the benefits of doing so. This may also be of some help for others. Here is a link to the project: http://www.codeproject.com/KB/cs/RtoCSharp.aspx Regards, Neil Gupta

Re: [R] C# and R

2008-06-13 Thread Prof Brian Ripley
This is about Windows, C# and R-(D)COM. The latter has its own list which would be much more appropriate. See http://sunsite.univie.ac.at/rcom/ (Linked from CRAN-Software-Other.) On Fri, 13 Jun 2008, Neil Gupta wrote: Hello R-Users, I came across this link on CodeProject.com and was

[R] Problem with Freq function {prettyR}

2008-06-13 Thread ukoenig
Does someone have an idea? Thanks a lot! Udo Quoting Udo [EMAIL PROTECTED]: Dear list, I have a problem with freq from prettyR. Please have a look at my syntax with a litte example: library(prettyR) #Version 1 test.df-data.frame(q1=sample(1:4,8,TRUE), gender=sample(c(f,m),8,TRUE))

[R] Access violation when calling Front41

2008-06-13 Thread Siyi FENG
Hello! When I tried to call Front41 in R, I met some problem. After I entered: system ('front41.exe'), an error occured : jwe0019i-u The program was terminated abnormally with Exception Code EXCEPTION_ACCESS_VIOLATION. error summary (Fortran) error number error level error count jwe0019i

[R] subsetting data-frame by vector of characters

2008-06-13 Thread james perkins
Hi, I have a very simple problem but I can't think how to solve it without using a for loop and creating a large logical vector. However given the nature of the problem I am sure there is a 1-liner that could do the same thing much more efficiently. bascially I have a dataframe with

[R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Bluder Olivia
Hello, I'm trying to calculate the Maximum likelihood estimators for a dataset which contains censored data. I started by using the function nlm, but isn't there a separate method for doing this for e.g. the weibull and the log-normal distribution? Thanks, Olivia

Re: [R] Package Installation produces linux/limits.h: No such file or directory error when installing the lpSolve package

2008-06-13 Thread Basileis
Hi, I too had this same problem but it got resolved by installing two packages : 1. kernel-headers 2. kernel-devel I hope this helps in your case. Regards Sharwan Joe_K wrote: Dear Friends, I am trying to install a few packages in R and am receiving error messages. Since the error

Re: [R] Problem with Freq function {prettyR}

2008-06-13 Thread James W. MacDonald
Since this is a contributed package, you should be contacting the maintainer (as mentioned in the posting guide). Anyway, the problem occurs because in the second case you have a factor in the first column and numeric in the second. This part of the code will illustrate what I mean: for (i

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread Chuck Cleland
On 6/13/2008 10:07 AM, james perkins wrote: Hi, I have a very simple problem but I can't think how to solve it without using a for loop and creating a large logical vector. However given the nature of the problem I am sure there is a 1-liner that could do the same thing much more

[R] histogram

2008-06-13 Thread Paul Adams
Hello everyone, I am trying to plot a histogram from the following code: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt,header=T,row.names=1) file.show(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt) x-dat[2,23:46]

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread Wacek Kusnierczyk
james perkins wrote: Hi, I have a very simple problem but I can't think how to solve it without using a for loop and creating a large logical vector. However given the nature of the problem I am sure there is a 1-liner that could do the same thing much more efficiently. bascially I have a

Re: [R] histogram

2008-06-13 Thread jim holtman
It is hard to respond without reproducible examples. Do str(dat[2,23:46]) and see what it reports. My guess is that one of the columns is not numeric. Find out which one it is, fix it and then try 'hist' again. On Fri, Jun 13, 2008 at 10:21 AM, Paul Adams [EMAIL PROTECTED] wrote: Hello

Re: [R] histogram

2008-06-13 Thread Erik Iverson
Paul Adams wrote: Hello everyone, I am trying to plot a histogram from the following code: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt,header=T,row.names=1) file.show(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt)

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread james perkins
Thanks a lot for that. Its the %in% I needed to work out mainly large didn't mean anything in particular, just that it gets quite long with the real data. I did mean: names = c(John, Phil, Robert) The only problem is that using the method you suggest is that I lose the indexing, ie in the

Re: [R] histogram

2008-06-13 Thread Lars Fischer
Hi, please someone correct me, but On 13/06/2008, 07:21, [EMAIL PROTECTED] wrote: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt,header=T,row.names=1) Check mode and class of dat. read.table provided you with a dataframe of, essentially, string data.

Re: [R] histogram

2008-06-13 Thread Peter Dalgaard
jim holtman wrote: It is hard to respond without reproducible examples. Do str(dat[2,23:46]) and see what it reports. My guess is that one of the columns is not numeric. Find out which one it is, fix it and then try 'hist' again. No, this will be wrong whatever the data are. The problem

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread Peter Dalgaard
james perkins wrote: Thanks a lot for that. Its the %in% I needed to work out mainly large didn't mean anything in particular, just that it gets quite long with the real data. I did mean: names = c(John, Phil, Robert) The only problem is that using the method you suggest is that I lose the

[R] package under unix

2008-06-13 Thread cgenolin
Hi the list, I write a package for clusterizing longitudinal data using a non parametric algorithm. I develop the package under windows. To be as user friendly as possible, the package use some graphical procedure to show to the user the evolution of the cluster construction, and to export

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread Wacek Kusnierczyk
james perkins wrote: Thanks a lot for that. Its the %in% I needed to work out mainly large didn't mean anything in particular, just that it gets quite long with the real data. I did mean: names = c(John, Phil, Robert) The only problem is that using the method you suggest is that I lose the

[R] Wanted: your examples of logged axes with custom tick marks

2008-06-13 Thread hadley wickham
Dear all, I'm trying to improve the default layout of tick marks for log scaled axes in ggplot2. To this end, it would be really useful to see what people actually do in practice. If you've ever made a log-log (or semi-log) plot and customised the location of the ticks, I'd really appreciate a

[R] CRAN package XML (omegahat)

2008-06-13 Thread David Keegan
Hi, I'm having issues using this package to parse large XML files. Where should bugs be reported? The omegahat website has several broken links. Regards David Keegan. -- __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Rest of a division

2008-06-13 Thread Eric Ferreira
Dear useRs, How do I ask for the rest of a division? For instantce, in C is like: 4%2 = 0 Best regards, -- Eric B Ferreira Exact Sciences Department Federal University of Lavras Brasil [[alternative HTML version deleted]] __

Re: [R] Rest of a division

2008-06-13 Thread Peter Dalgaard
Eric Ferreira wrote: Dear useRs, How do I ask for the rest of a division? For instantce, in C is like: 4%2 = 0 Best regards, 4%%2 [1] 0 -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*)

Re: [R] Rest of a division

2008-06-13 Thread Charilaos Skiadas
?%% On Jun 13, 2008, at 11:23 AM, Eric Ferreira wrote: Dear useRs, How do I ask for the rest of a division? For instantce, in C is like: 4%2 = 0 Best regards, -- Eric B Ferreira Exact Sciences Department Federal University of Lavras Brasil Haris Skiadas Department of Mathematics and

Re: [R] CRAN package XML (omegahat)

2008-06-13 Thread Martin Morgan
Bugs to the package maintainer, for this and all packages packageDescription('XML')[['Maintainer']] [1] Duncan Temple Lang [EMAIL PROTECTED] Best luck will come with the usual, sessionInfo(), easily reproducible and compact example, use of current software versions, etc. Martin David

Re: [R] Sweave: looping over mixed R/LaTeX code

2008-06-13 Thread Jeffrey Horner
Stephan Kolassa wrote on 06/13/2008 03:22 AM: Dear guRus, I would like to loop over a medium amount of Sweave code, including both R and LaTeX chunks. Is there any way to do so? As an illustration, can I create a .tex file like this using a loop within a .Rnw file, where the 1,2,3 comes from

Re: [R] Rest of a division

2008-06-13 Thread Erik Iverson
?Arithmetic Eric Ferreira wrote: Dear useRs, How do I ask for the rest of a division? For instantce, in C is like: 4%2 = 0 Best regards, __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] help with colsplit (reshape)

2008-06-13 Thread Ista Zahn
Dear list, I'm trying to figure out how to use the reshape package to reshape data from a wide format to a long format. I have data like this pid - c(1:10) predA - c(-1,-2,-1,-2,-1,-2,-1,-2,-1,-2) predB.1 - c(0,0,0,1,1,0,0,0,1,1) predB.2 - c(2,2,3,3,3,2,2,3,3,3) predC.1 -

Re: [R] Looping, Control Flow Conditional Statements

2008-06-13 Thread Charles C. Berry
See ?rle Start with this: a1.runs - rle( a1 ) a1.runs$lengths[ a1.runs$values0 ] [1] 3 4 HTH, Chuck p.s. library(fortunes) fortune(106) If the answer is parse() you should usually rethink the question. -- Thomas Lumley R-help (February 2005) -- see ?get

Re: [R] alternative to matching/merge?

2008-06-13 Thread Lana Schaffer
Jim, My code is this: mergefunc - function(x,seqFile){ # merge(seqFile,x) cbind(x, seqFile[ match(as.vector(x$index), as.vector(seqFile$index)), ]) } LIX - lapply(d.frame[[1]], mergefunc,seqFile=seqFile) Each matrix/data.frame takes 0.2 seconds and then to do this 1240 times takes ~4 minutes.

Re: [R] Problem with Freq function {prettyR}

2008-06-13 Thread ukoenig
Thanks a lot, Jim! Since this is a contributed package, you should be contacting the maintainer (as mentioned in the posting guide). sorry Anyway, the problem occurs because in the second case you have a factor in the first column and numeric in the second. This part of the code will

Re: [R] alternative to matching/merge?

2008-06-13 Thread jim holtman
What is the structure of 'd.frame' and 'segFile'? Run Rprof so that we can see which of the functions it is spending its time in. What happens if x$index is not in seqFile$index? Are the values in the 'index' unique in both structures? Subsetting a data frame can be expensive when compared to

Re: [R] alternative to matching/merge?

2008-06-13 Thread Lana Schaffer
Jim, d.frame[[i]] is a list of data.frames and seqFile is a data.frame. I have coverted them to vectors/matrixes and the timing is the same as data.frame. 'index' is unique in both structures. The list is subset into data.frame/matrix structures. Lana -Original Message- From: jim

[R] Level Plot and Scale of Colorkey

2008-06-13 Thread emma hartnett
I am drawing level plots but I would like to specify the range of the colorkey, I am not having any success figuring this out so any help would be greatly appreciated! Here is an example of what I am trying to do: disp-1 x - seq(1, 10,by=1) y - seq(1,10,by=1) g - expand.grid(x = x, y = y)

[R] cluster.stats

2008-06-13 Thread Laura Poggio
Dear list, I just tried to use the function cluster.stat in the package fpc. I just have a couple of questions about the syntax: cluster.stats(d,clustering,alt.clustering=NULL, silhouette=TRUE,G2=FALSE,G3=FALSE) 1) the distance object (d) is an object obtained by the function dist() on my own

Re: [R] Level Plot and Scale of Colorkey

2008-06-13 Thread Toby Marthews
Try colscaledivs=100#colscaledivs=15 here is the R default levelplot(z ~ x * y, g,xlab=x co-ordinate,ylab=y co-ordinate,colorkey=TRUE,at=seq(from=-0.01,to=0.25,length=colscaledivs),col.regions=(col=gray((0:colscaledivs)/colscaledivs))) Toby Marthews Le Ven 13 juin 2008 18:50,

[R] restricted coefficient and factor for linear regression.

2008-06-13 Thread Oh Dong-hyun
Hi, my data set is data.frame(id, yr, y, l, e, k). I would like to estimate Lee and Schmidts (1993, OUP) model in R. My colleague wrote SAS code as follows: ** procedures for creating dummy variables are omitted ** ** di# and dt# are dummy variables for industry and time ** data a2; merge a1

Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Ben Bolker
Bluder Olivia olivia.bluder at k-ai.at writes: Hello, I'm trying to calculate the Maximum likelihood estimators for a dataset which contains censored data. I started by using the function nlm, but isn't there a separate method for doing this for e.g. the weibull and the log-normal

[R] nls() vs lm() estimates

2008-06-13 Thread Héctor Villalobos
Hi, I'm trying to understand why the coefficients a and b for the model: W = a*L^b estimated via nls() differs from those obtained for the log transformed model: log(W) = log(a) + b*log(L) estimated via lm(). Also, if I didn't make a mistake, R-squared suggests a better adjustment for the

Re: [R] cluster.stats

2008-06-13 Thread Christian Hennig
Dear Laura, Dear list, I just tried to use the function cluster.stat in the package fpc. I just have a couple of questions about the syntax: cluster.stats(d,clustering,alt.clustering=NULL, silhouette=TRUE,G2=FALSE,G3=FALSE) 1) the distance object (d) is an object obtained by the function

Re: [R] help with colsplit (reshape)

2008-06-13 Thread hadley wickham
M.Data2 - data.frame(M.Data, colsplit(M.Data$variable, split = \\., names = c(treatment, time))) which gave: head(M.Data2) pid variable value treatment time 1 1predA-1 predA predA 2 2predA-2 predA predA 3 3predA-1 predA predA 4 4predA

Re: [R] nls() vs lm() estimates

2008-06-13 Thread Janne Huttunen
Héctor Villalobos wrote: Hi, I'm trying to understand why the coefficients a and b for the model: W = a*L^b estimated via nls() differs from those obtained for the log transformed model: log(W) = log(a) + b*log(L) estimated via lm(). Also, if I didn't make a mistake, R-squared suggests a

Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Vincent Goulet
Le ven. 13 juin à 13:55, Ben Bolker a écrit : Bluder Olivia olivia.bluder at k-ai.at writes: Hello, I'm trying to calculate the Maximum likelihood estimators for a dataset which contains censored data. I started by using the function nlm, but isn't there a separate method for doing

Re: [R] nls() vs lm() estimates

2008-06-13 Thread Janne Huttunen
Janne Huttunen wrote: Héctor Villalobos wrote: Hi, I'm trying to understand why the coefficients a and b for the model: W = a*L^b estimated via nls() differs from those obtained for the log transformed model: log(W) = log(a) + b*log(L) estimated via lm(). Also, if I didn't make a mistake,

[R] Quartile regression question

2008-06-13 Thread Ranney, Steven
I have data that looks like lake,loglength,logweight 1,2.369215857,1.929418926 1,2.426511261,2.230448921 1,2.434568904,2.298853076 1,2.437750563,2.298853076 1,2.442479769,2.230448921 1,2.445604203,2.356025857 ... 102,2.722633923,3.310268367 102,2.781755375,3.502153893 102,2.836324116,3.683407299

Re: [R] help with colsplit (reshape)

2008-06-13 Thread Ista Zahn
Thanks Hadley, with your help I'm getting things figured out. On Jun 13, 2008, at 2:09 PM, hadley wickham wrote: M.Data2 - data.frame(M.Data, colsplit(M.Data$variable, split = \ \., names = c(treatment, time))) which gave: head(M.Data2) pid variable value treatment time 1 1predA-1

Re: [R] Quartile regression question

2008-06-13 Thread Philippe Grosjean
Hello, Look at package quantreg. Philippe Grosjean Ranney, Steven wrote: I have data that looks like lake,loglength,logweight 1,2.369215857,1.929418926 1,2.426511261,2.230448921 1,2.434568904,2.298853076 1,2.437750563,2.298853076 1,2.442479769,2.230448921 1,2.445604203,2.356025857 ...

Re: [R] Quartile regression question

2008-06-13 Thread Ranney, Steven
Thanks for your help. Worked great. SR Steven H. Ranney Graduate Research Assistant (Ph.D) USGS Montana Cooperative Fishery Research Unit Montana State University PO Box 173460 Bozeman, MT 59717-3460 phone: (406) 994-6643 fax: (406) 994-7479 [[alternative HTML version deleted]]

Re: [R] help with colsplit (reshape)

2008-06-13 Thread hadley wickham
Right, there is no time associated with this variable. So I tried again, treating it as an id: M.Data - melt(Data, id = c(pid, predA)) From here I was able to achieve the desired result, as follows: M.Data - data.frame(M.Data, colsplit(M.Data$variable, split = \\., names=c(measure,

Re: [R] alternative to matching/merge?

2008-06-13 Thread hadley wickham
On Fri, Jun 13, 2008 at 11:45 AM, jim holtman [EMAIL PROTECTED] wrote: What is the structure of 'd.frame' and 'segFile'? Run Rprof so that we can see which of the functions it is spending its time in. What happens if x$index is not in seqFile$index? Are the values in the 'index' unique in

[R] stretching text vertically

2008-06-13 Thread Alex Reynolds
I'd like to stretch a plotted character vertically, to create a sequence logo. Is there a parameter to allow stretching text() output vertically or squeeze horizontally? I know about Oliver Bembom's seqLogo library, but this generates a sequence logo plot using a separate bitmap device. I

[R] Importing data with different delimters

2008-06-13 Thread David Arnold
All, I have a data file with 56 entries that looks like this: City State JanTemp Lat Long Mobile, AL 44 31.288.5 Montgomery, AL 38 32.986.8 Phoenix, AZ 35 33.6112.5 Little Rock, AR 31 35.492.8 Los Angeles, CA 47 34.3118.7 San

[R] Help with stat.table in Epi package,

2008-06-13 Thread Troy S
R Fans-- I am having problems with the following code. It worked under R 2.6.0 but not in 2.7.0. library(Epi) df - read.table( c:/Documents and Settings/Troy S/My Documents/debug_chisq_080613b.txt) summary(df) cvd agecat Min. :0. (0,40] :1 1st Qu.:0.

Re: [R] Importing data with different delimters

2008-06-13 Thread jim holtman
Assuming that the only problem is the blank in the city names, here is one way of doing it: inFile - textConnection(City State JanTemp Lat Long + Mobile, AL 44 31.288.5 + Montgomery, AL 38 32.986.8 + Phoenix, AZ 35 33.6112.5 + Little Rock, AR 31

[R] rbind() problem

2008-06-13 Thread array chip
Hi, I would like to rbind 2 data frames. They both some common column names, but also some unique column names each, is there any simple function that rbind these 2 data frames with filling NAs for those columns of unique names? thanks __

[R] Correcting the display of colnames and rownames

2008-06-13 Thread Steve Murray
Dear all, I have a data frame of dimension 720 columns by 360 rows, to which I am trying to add numerical row and column labels to, using the 'sequence' command. The original data, which I read in using 'read.table', had no such labels at all. I've got as far as successfully using the

Re: [R] Using lm with a matrix?

2008-06-13 Thread jonboym
Many thanks, works great! Charilaos Skiadas-3 wrote: Try this: lapply( 1:2, function(i) lm( y~x, data=list(x=xdat[,i], y=ydat[,i]) ) ) Haris Skiadas -- View this message in context: http://www.nabble.com/Using-lm-with-a-matrix--tp17708207p17829661.html Sent from the R help mailing

[R] Weights and coxph

2008-06-13 Thread mah
I am confuse by the results of the weights option for coxph. I replicated each row three times from the help page for coxph in the data frame test_freq. I had expected that the coefficients, significance tests, and tests of non-proportionality would yield the same results for the replicated and

[R] overlaid transparent histograms

2008-06-13 Thread Austin Frank
Hello all-- I'm attempting to produce overlaid histograms with partially transparent columns. Whether this display will end up being useful, I can't say. But I do want to get it right. I've already got one solution (shown below), but I tried some other versions and had questions about my

[R] False convergence in LME

2008-06-13 Thread Rebecca Sela
I tried to use LME (on a fairly large dataset, so I am not including it), and I got this error message: Error in lme.formula(formula(paste(c(toString(TargetName), as.factor(nodeInd)), : nlminb problem, convergence error code = 1 message = false convergence (8) Is there any way to get

[R] Subset by Factor by date

2008-06-13 Thread T.D.Rudolph
I have a dataframe, x, with over 60,000 rows that contains one Factor, id, with 27 levels. The dataframe contains numerous continuous values (along column diff) per day (column date) for every level of id. I would like to select only one row per animal per day, i.e. that containing the minimum

Re: [R] Subset by Factor by date

2008-06-13 Thread Marc Schwartz
on 06/13/2008 11:10 PM T.D.Rudolph wrote: I have a dataframe, x, with over 60,000 rows that contains one Factor, id, with 27 levels. The dataframe contains numerous continuous values (along column diff) per day (column date) for every level of id. I would like to select only one row per

Re: [R] Looping, Control Flow Conditional Statements

2008-06-13 Thread Garth.Warren
Thanks Chuck, 'rle' was just what I needed. G -Original Message- From: Charles C. Berry [mailto:[EMAIL PROTECTED] Sent: Saturday, 14 June 2008 02:00 To: Warren, Garth (CSE, Gungahlin) Cc: r-help@r-project.org Subject: Re: [R] Looping, Control Flow Conditional Statements See

Re: [R] overlaid transparent histograms

2008-06-13 Thread hadley wickham
Three questions: 1a) Why does the following code not produce transparent bars? Because you're setting the fill colour (not mapping it to a variable in your dataset), the fill needs to be outside of aes() g + geom_histogram(aes(x=log(BNCw)), fill = alpha(red, .5)) +

Re: [R] Subset by Factor by date

2008-06-13 Thread T.D.Rudolph
aggregate() is indeed a useful function in this case, but it only returns the columns by which it was grouped. Is there a way I can use this while simultaneously retaining all the other column values in the dataframe? e.g. add superfluous (yet pertinent for later) column containing any

[R] strsplit, keeping delimiters

2008-06-13 Thread hadley wickham
Hi all, Does anyone have a version of strsplit that keeps the string that is split by. e.g. from x - A: 123 B: 456 C: 678 I'd like to get c(A:, 123 , B: , 456 , C: , 678) but strsplit(x, [A-Z]+:) gives me c(, 123 , 456 , 678) Any ideas? Thanks, Hadley -- http://had.co.nz/

Re: [R] rbind() problem

2008-06-13 Thread Tobias Verbeke
Hi array (?), Hi, I would like to rbind 2 data frames. They both some common column names, but also some unique column names each, is there any simple function that rbind these 2 data frames with filling NAs for those columns of unique names? You can use the reshape package by Hadley

Re: [R] Subset by Factor by date

2008-06-13 Thread Charilaos Skiadas
On Jun 14, 2008, at 1:25 AM, T.D.Rudolph wrote: aggregate() is indeed a useful function in this case, but it only returns the columns by which it was grouped. Is there a way I can use this while simultaneously retaining all the other column values in the dataframe? e.g. add superfluous

Re: [R] strsplit, keeping delimiters

2008-06-13 Thread Gabor Grothendieck
Try this: library(gsubfn) x - A: 123 B: 456 C: 678 strapply(x, [^ :]+[ :]|[^ :]+$) [[1]] [1] A: 123 B: 456 C: 678 and check out the gsubfn home page at: http://gsubfn.googlecode.com On Sat, Jun 14, 2008 at 1:35 AM, hadley wickham [EMAIL PROTECTED] wrote: Hi all, Does anyone have