Re: [R] reading a .mdf file in R

2011-05-09 Thread Prof Brian Ripley
And we have little idea what the format of a .mdf file is. (It has multiple meanings, see e.g. http://www.delphifaq.com/faq/f777.shtml.) Since you mention 'with SQL', maybe you meant 'Microsoft SQL Server', some (older?) versions of which have '.mdf' files. The short answer in that case is

Re: [R] reading a .mdf file in R

2011-05-09 Thread Jeff Newmiller
You need to go study SQLServer database administration for awhile... and this is not the place for that. (A book is advisable.) You will also need to set up an ODBC Data Source Name for open connectivity to that database. You should also start learning how to use RODBC to send SQL

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-09 Thread peter dalgaard
On May 9, 2011, at 06:07 , Alex Olssen wrote: Thank you all for your input. Unfortunately my problem is not yet resolved. Before I respond to individual comments I make a clarification: In Stata, using the same likelihood function as above, I can reproduce EXACTLY (to 3 decimal places

[R] Summarising by group

2011-05-09 Thread Martyn Byng
I wonder if someone with more experience than me on using R to summarise by group wants to post a reply to this http://www.analyticbridge.com/group/sasandstatisticalprogramming/forum/t opics/why-still-use-sas-with-a-lot To save everyone having to follow the link, the text is copied below SAS

Re: [R] Summarising by group

2011-05-09 Thread peter dalgaard
On May 9, 2011, at 11:12 , Martyn Byng wrote: I wonder if someone with more experience than me on using R to summarise by group wants to post a reply to this Not really (but how did those people manage to overlook by()?). However, another matter PLEASE DO NOT BE SO B***DY LAZY AND START A

[R] Suppressing iterations in DEoptim

2011-05-09 Thread arnab . maity
Dear R users, During the the running of DEoptim function which belongs to DEoptim package it automatically gives the output like the following: Iteration: 1 bestvalit: 181.379847 bestmemit:0.2264991.395852 Iteration: 2 bestvalit: 14.062649 bestmemit:2.2903575.597838 Iteration: 3

[R] Rule based Classification

2011-05-09 Thread Denny
Dear R-help. I am studying Dataming using R and I am going to make Rule Based Classification's R code. But I searched for Rule Based Classification throught Google, I have failed to find out the package for R. Would you recommend R some packages which can make Rule Based Classification? Best

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-09 Thread Alex Olssen
Peter said Ahem! You might get us interested in your problem, but not to the level that we are going to install Stata and Tsp and actually dig out and study the scientific paper you are talking about. Please cite the results and explain the differences. Apologies Peter, will do, The results

[R] converting a matrix or data.frame into an html table

2011-05-09 Thread Samuel Le
Dear all, Is there a function in R to convert a matrix or a data.frame into an html table? Many thanks, Samuel [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Alter a line in a file.

2011-05-09 Thread Patrick Connolly
On Thu, 05-May-2011 at 06:13AM -0700, Joel wrote: | | jholtman wrote: | | a - readLines(textConnection('setting1=value1 | setting2=value2 | setting3=value3 | setting4=value4')) | closeAllConnections() | # change values | ac - sub('setting4=value4', 'setting4=value5', a) |

Re: [R] converting a matrix or data.frame into an html table

2011-05-09 Thread Gerrit Eichner
Hello, Samuel, take a look at the package R2HTML. Hth -- Gerrit On Mon, 9 May 2011, Samuel Le wrote: Dear all, Is there a function in R to convert a matrix or a data.frame into an html table? Many thanks, Samuel -

Re: [R] Suppressing iterations in DEoptim

2011-05-09 Thread Uwe Ligges
On 09.05.2011 11:06, arnab.ma...@dc.ibm.com wrote: Dear R users, During the the running of DEoptim function which belongs to DEoptim package it automatically gives the output like the following: Iteration: 1 bestvalit: 181.379847 bestmemit:0.2264991.395852 Iteration: 2 bestvalit:

Re: [R] package update

2011-05-09 Thread Uwe Ligges
On 08.05.2011 19:54, eric wrote: I tried to update my packages using update.packages() I got the following message: The downloaded packages are in ‘/tmp/RtmpyDYdTX/downloaded_packages’ Warning in install.packages(update[instlib == l, Package], l, contriburl = contriburl, : 'lib =

Re: [R] converting a matrix or data.frame into an html table

2011-05-09 Thread Gregoire Pau
Have a look at hwrite() in the hwriter package: http://www.embl.de/~gpau/hwriter/index.html If x is a data frame, the following will do it: library(hwriter) hwrite(x, x.html) Cheers, Greg --- Gregoire Pau EMBL Research Officer http://www.embl.de/~gpau/ On 09/05/11 12:40, Samuel Le wrote:

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-09 Thread Alex Olssen
Hi Mike, Mike said is this it, page 1559? That is the front page yes, page 15*6*9 has the table, of which the model labelled 18s is the one I replicated. did you actually cut/paste code anywhere and is your first coefficient -.19 or -.019? Presumably typos would be one possible problem. -0.19

Re: [R] Suppressing iterations in DEoptim

2011-05-09 Thread arnab . maity
Dear Uwe, Which help file you are talking about? Thanks Regards Arnab Kumar Maity || IBM Global Process Services || || 2nd Floor, VBC Solitaire || || 47 49, Bazullah Road || T Nagar || || Chennai - 600017 || India || || Email: arnab.ma...@dc.ibm.com || || Ph: +91 8939390048 ||

Re: [R] converting a matrix or data.frame into an html table

2011-05-09 Thread David Scott
On 9/05/2011 10:40 p.m., Samuel Le wrote: Dear all, Is there a function in R to convert a matrix or a data.frame into an html table? Many thanks, Samuel xtable() in the xtable package can do this (at least to some extent). It is commonly used to write LaTeX but there is an option to

Re: [R] Suppressing iterations in DEoptim

2011-05-09 Thread Uwe Ligges
On 09.05.2011 13:47, arnab.ma...@dc.ibm.com wrote: Dear Uwe, Which help file you are talking about? The one you get when typing ?DEoptim which one do you think is more appropriate for getting help on DEoptim ? Uwe Thanks Regards Arnab Kumar Maity || IBM Global Process Services ||

Re: [R] Suppressing iterations in DEoptim

2011-05-09 Thread arnab . maity
Dear Uwe, I already have gone through that document. But I could not find the solution. Thanks Regards Arnab Kumar Maity || IBM Global Process Services || || 2nd Floor, VBC Solitaire || || 47 49, Bazullah Road || T Nagar || || Chennai - 600017 || India || || Email: arnab.ma...@dc.ibm.com ||

Re: [R] Suppressing iterations in DEoptim

2011-05-09 Thread Uwe Ligges
On 09.05.2011 14:03, arnab.ma...@dc.ibm.com wrote: Dear Uwe, I already have gone through that document. But I could not find the solution. I tiold you that help page points us to the help page for ?DEoptim.control and that one has an argument trace. Please read both, my original message as

Re: [R] Weighted box or violin plots in Lattice?

2011-05-09 Thread David Winsemius
On May 9, 2011, at 12:35 AM, Deepayan Sarkar wrote: On Mon, May 9, 2011 at 2:20 AM, Thomas Lumley tlum...@uw.edu wrote: On Mon, May 9, 2011 at 6:35 AM, Deepayan Sarkar deepayan.sar...@gmail.com wrote: On Sat, May 7, 2011 at 1:55 AM, Raphael Mazor rapha...@sccwrp.org wrote: Is it possible to

Re: [R] Hosmer-Lemeshow 'goodness of fit'

2011-05-09 Thread Frank Harrell
The test in the rms package's residuals.lrm function is the le Cessie - van Houwelingen - Copas - Hosmer unweighted sum of squares test for global goodness of fit. Like all statistical tests, a large P-value has no information other than there was not sufficient evidence to reject the null

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-09 Thread Mike Marchywka
Date: Mon, 9 May 2011 22:06:38 +1200 From: alex.ols...@gmail.com To: pda...@gmail.com CC: r-help@r-project.org; da...@otter-rsch.com Subject: Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

[R] rquest for help

2011-05-09 Thread Pawan Kakchingtabam
Sir, Kindlly Guide me how to get the R CELFILES. I have install R but I cannat asses the command: Data - ReadAffy() and I got the error: Error in AllButCelsForReadAffy(..., filenames = filenames, widget = widget, : No cel filennames specified and no cel files in specified

[R] Mixed-design ANOVA: 2 between-subject factors and 1 within-subject factor

2011-05-09 Thread Floating0914
Dear all, I am trying to using a mixed-design ANOVA to analyze my data. I have two between subject variables: location (2 different locations) and age group (young and old), and one within-subject variable: valence (positive, neutral, negative). I am looking at an Stevens(one between, two

Re: [R] coxph and survfit issue - strata

2011-05-09 Thread Terry Therneau
Dear users, In a study with recurrent events: My objective is to get estimates of survival (obtained through a Cox model) by rank of recurrence and by treatment group. With the following code (corresponding to a model with a global effect of the treatment=rx), I get no error and manage

Re: [R] rquest for help

2011-05-09 Thread Martin Morgan
On 05/09/2011 01:19 AM, Pawan Kakchingtabam wrote: Sir, Kindlly Guide me how to get the R CELFILES. I have install R but I cannat asses the command: Data- ReadAffy() and I got the error: Error in AllButCelsForReadAffy(..., filenames = filenames, widget = widget, : No cel filennames

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-09 Thread peter dalgaard
On May 9, 2011, at 13:40 , Alex Olssen wrote: Hi Mike, Mike said is this it, page 1559? That is the front page yes, page 15*6*9 has the table, of which the model labelled 18s is the one I replicated. However, the R code you posted will at best replicate model 18. For 18s, you need

[R] Recursive Indexing Failed

2011-05-09 Thread Alaios
Dear all, I would like to ask your help concerning an error message I get. I have the following struct str(CRagentInTime[[1]]) List of 2 $ timelag: int 0 $ CRagent:List of 50 ..$ :List of 3 .. ..$ CRmap: num [1:256, 1:256] NA NA NA NA NA NA NA NA NA NA ... .. ..$ xy : num [1:2] 10 177

Re: [R] Weighted box or violin plots in Lattice?

2011-05-09 Thread Deepayan Sarkar
On Mon, May 9, 2011 at 5:42 PM, David Winsemius dwinsem...@comcast.net wrote: On May 9, 2011, at 12:35 AM, Deepayan Sarkar wrote: On Mon, May 9, 2011 at 2:20 AM, Thomas Lumley tlum...@uw.edu wrote: On Mon, May 9, 2011 at 6:35 AM, Deepayan Sarkar deepayan.sar...@gmail.com wrote: On Sat,

Re: [R] Recursive Indexing Failed

2011-05-09 Thread Patrick Breheny
On 05/09/2011 08:58 AM, Alaios wrote: Dear all, I would like to ask your help concerning an error message I get. I have the following struct str(CRagentInTime[[1]]) List of 2 $ timelag: int 0 $ CRagent:List of 50 ..$ :List of 3 .. ..$ CRmap: num [1:256, 1:256] NA NA NA NA NA NA NA NA

Re: [R] Recursive Indexing Failed

2011-05-09 Thread Alaios
So the only thing that might work is a for..loop to collect all these together? Best REgards Alex --- On Mon, 5/9/11, Patrick Breheny patrick.breh...@uky.edu wrote: From: Patrick Breheny patrick.breh...@uky.edu Subject: Re: [R] Recursive Indexing Failed To: Alaios ala...@yahoo.com Cc:

Re: [R] Recursive Indexing Failed

2011-05-09 Thread peter dalgaard
On May 9, 2011, at 15:24 , Alaios wrote: So the only thing that might work is a for..loop to collect all these together? An implicit loop using lapply/sapply might be more like it: lapply(CRagentInTime[[1]]$CRagent[1:10], [[, sr) Notice that fancy indexing usually requires [, not [[.

[R] Create subsets of data

2011-05-09 Thread Pavan G
Hello All, Let's say I have points on a x-y plane. x ranges from 0-2 and y from 0-2. There are points in quadrants x[0:1]---y[0:1] and in x[1:2]y[1:2]. I would like to get the mean and std of the points in the x[0:1]y[0:1] quadrant alone. Is there a straight forward way to do it? I asked

Re: [R] Recursive Indexing Failed

2011-05-09 Thread Patrick Breheny
On 05/09/2011 09:24 AM, Alaios wrote: So the only thing that might work is a for..loop to collect all these together? Best REgards Alex You could also use sapply: x - list(list(One=a,Two=c(b,c)),list(One=d,Two=c(e,f))) sapply(x,'[[',Two) [,1] [,2] [1,] b e [2,] c f In your example,

Re: [R] Recursive Indexing Failed

2011-05-09 Thread Duncan Murdoch
On 09/05/2011 9:18 AM, Patrick Breheny wrote: On 05/09/2011 08:58 AM, Alaios wrote: Dear all, I would like to ask your help concerning an error message I get. I have the following struct str(CRagentInTime[[1]]) List of 2 $ timelag: int 0 $ CRagent:List of 50 ..$ :List of

Re: [R] Recursive Indexing Failed

2011-05-09 Thread Patrick Breheny
On 05/09/2011 09:52 AM, Duncan Murdoch wrote: In general, the expression x[[1:2]] is not meaningful, as the elements of the list may be of different type, with no way to concatenate them. That's the wrong explanation: the expression x[[1:2]] is meaningful, but it means the same thing as

Re: [R] Recursive Indexing Failed

2011-05-09 Thread Alaios
Thank you very much all for your time. For now I am doing this with a simple for loop as some times lapply,sapply makes things more complex (or in other words I am not that experience using it). Best REgards Alex --- On Mon, 5/9/11, Patrick Breheny patrick.breh...@uky.edu wrote: From:

[R] Round down to earliest hour or half hour

2011-05-09 Thread Schatzi
I have times and would like to round down to the earliest 30 minute increment. For instance, a time of 2011-04-28 09:02:00 (the as.numeric value = 1303999320) I would like it to be rounded down to: 2011-04-28 09:00:00 (the as.numeric value = 1303999200) Any ideas of how to do this? - In

[R] Using NULL to my data?

2011-05-09 Thread Nilza BARROS
Dear R users, I am reading data from a file where there are some missing that are represented by -.00. I am using the command below. =My original data === PARM = TMPC;T12X;T12N;DWPC;PALT;SKNT;DRCT;P24M;CLCL STNYYMMDD/HHMM TMPC T12X T12N DWPC PALT

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-09 Thread peter dalgaard
Hmm, I tried replacing the x's in the model with their principal component scores, and suddenly everything converges as a greased lightning: Z - princomp(cbind(x1,x2,x3))$scores Z - as.data.frame(princomp(cbind(x1,x2,x3))$scores) names(Z)- letters[1:3] optimx(rep(0,8),lnl, hessian=TRUE,

Re: [R] Summarising by group

2011-05-09 Thread Ista Zahn
Trolling? (but see in line below) On Mon, May 9, 2011 at 5:12 AM, Martyn Byng martyn.b...@nag.co.uk wrote: I wonder if someone with more experience than me on using R to summarise by group wants to post a reply to this http://www.analyticbridge.com/group/sasandstatisticalprogramming/forum/t

Re: [R] How to alter circle size

2011-05-09 Thread Dat Mai
Thanks for the help! Though, when I do this, I get a message saying Error using packet 1 value where TRUE/FALSE. Would that have anything to do with this set of code? On Sun, May 8, 2011 at 3:00 PM, Deepayan Sarkar deepayan.sar...@gmail.comwrote: On Fri, May 6, 2011 at 10:21 PM, Dat Mai

[R] Time Series

2011-05-09 Thread Nicole Gross-Camp
I have what I hope is a simple question - is it possible to do time series analysis on a small data set specifically only four data points? I have collected human threat data (mean number of threats per kilometre walked/ survey) every 3 months in eight different sites (four with an

Re: [R] %in% operator - NOT IN

2011-05-09 Thread Karl Ove Hufthammer
Dan Abner wrote: I am attempting to use the %in% operator with the ! to produce a NOT IN type of operation. Just use the ‘%nin‰’ operator in the ‘Hmisc’ package. :-) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list

Re: [R] Time Series

2011-05-09 Thread Uwe Ligges
Although this is not an R question actually, if I get such a question in our consulting centre, my advice is: Present a table of your 4 observations and that's it from a quantitative point of view. There is no sense in modelling or testing with 4 observations. Best, Uwe Ligges On

[R] Odp: Using NULL to my data?

2011-05-09 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.05.2011 16:07:27: Nilza BARROS nilzabar...@gmail.com Odeslal: r-help-boun...@r-project.org 09.05.2011 16:07 Dear R users, I am reading data from a file where there are some missing that are represented by -.00. I am using the

Re: [R] Round down to earliest hour or half hour

2011-05-09 Thread Jannis
I would use package chron and trunc() One example from the help of trunc.times (modified): lirary(chron) tt - times(c(12:13:14, 15:46:17)) trunc(tt, times(00:30:00)) HTH Jannis --- Schatzi adele_thomp...@cargill.com schrieb am Mo, 9.5.2011: Von: Schatzi adele_thomp...@cargill.com

Re: [R] Pretty printing numbers

2011-05-09 Thread Peter Ehlers
On 2011-05-08 16:41, Worik R wrote: Friends I am trying to format a number to a string so 2189.745 goes to 2,189.35 and 309283.929 goes to 309,283.93 I have tried to use formatC(X, big.mark=,,drop0trailing=FALSE, format=f) but it does not get the number of decimals correct. Specifying digits

Re: [R] Using NULL to my data?

2011-05-09 Thread David Winsemius
On May 9, 2011, at 10:07 AM, Nilza BARROS wrote: Dear R users, I am reading data from a file where there are some missing that are represented by -.00. I am using the command below. =My original data === PARM = TMPC;T12X;T12N;DWPC;PALT;SKNT;DRCT;P24M;CLCL snipped But I

Re: [R] Vermunt's LEM in R

2011-05-09 Thread David Joubert
Sure, sorry for not clarifying from the beginning. LEM is a rather powerful software for conducting general loglinear analysis, including latent class, logit, latent Markov, Event History models, etc. It's very polyvalent. Link to the software and document is at

Re: [R] Vermunt's LEM in R

2011-05-09 Thread David Joubert
Basically I do LCA, followed by some kind of analysis intended to validate the solutions. For example, I would create latent class solutions for each gender based on four dichotomic indicators of psychosis. Next, I would look at the interaction of current psychiatric status (the classes) and

[R] Vectorizing a function: what does it mean?

2011-05-09 Thread Ron Michael
Dear all, I would really appreciate if somebody can help me to understand what does the phrase Vectorize your function mean? And what is the job of Vectorize() function in doing that? I have read many threads where experts suggest to Vectorize the function, which will speed up entire

Re: [R] Using NULL to my data?

2011-05-09 Thread Nilza BARROS
Dear Ruser, Thank for your help. I've just tried the command below and it works Alldados[is.na(Alldados)]-NULL But I am facing other problem, since I need to format my data before feeding my database. I am using the command below: with(Alldados,sprintf(INSERT INTO OBS

Re: [R] Using NULL to my data?

2011-05-09 Thread Gabor Grothendieck
You certainly can't assign a character string into a numeric column. There is no reason to expect that to work. Can you provide some clarity on what the problem is in terms of a very small self contained example explaining what you get and what you expected to get. Regards. On Mon, May 9, 2011

Re: [R] Vermunt's LEM in R

2011-05-09 Thread Wincent
What is L_square? Is it Likelihood ratio/deviance statistic which is reported by poLCA? The predcell component contains observed and expected, isn't it easy to get the residuals? If you want the logit/logistic model, glm or lrm (rms) can do the job. It is unrealistic to expect different software

Re: [R] Using NULL to my data?

2011-05-09 Thread Nilza BARROS
Hi, Thanks for your attentio. I have the data frame below: head(Alldados) Station_NO date1 T_2M TMAX_2M TMIN_2M TD_2M PS FF_10M DD_10M 1 820420 110429/1200 22.5NULL22.4 22.2 NULL 0 0 2 820980 110429/1200 26.9NULL23.4 24.1 1010.2 2.91

Re: [R] Using NULL to my data?

2011-05-09 Thread Gabor Grothendieck
On Mon, May 9, 2011 at 12:59 PM, Nilza BARROS nilzabar...@gmail.com wrote: Hi, Thanks for your attentio. I have the data frame below: head(Alldados)   Station_NO   date1 T_2M TMAX_2M TMIN_2M TD_2M PS FF_10M DD_10M 1 820420 110429/1200 22.5    NULL    22.4  22.2   NULL 

Re: [R] Vectorizing a function: what does it mean?

2011-05-09 Thread David Winsemius
On May 9, 2011, at 11:57 AM, Ron Michael wrote: Dear all, I would really appreciate if somebody can help me to understand what does the phrase Vectorize your function mean? And what is the job of Vectorize() function in doing that? I have read many threads where experts suggest to

[R] Fortran Symbol Name not in Load Table

2011-05-09 Thread vioravis
I am trying to call a FORTRAN subroutine from R. is.loaded is turning out to be TRUE. However when I run my .Fortran command I get the following error: Error in .Fortran(VALUEAHROPTIMIZE, as.double(ahrArray), as.double(kwArray), : Fortran symbol name valueahroptimize not in load table I

[R] arima residuals

2011-05-09 Thread Luis Solis
Hi I have fitted an arima model to a monthly series of length 113. I have use fit - arima(x.ts, order = c(1,0,0),seas = list(order = c(1,2,1),12, method = CSS) I'm a little confused because the series of residual has the first 46 values equal to 0. From there the residuals are approximately

Re: [R] Time Series

2011-05-09 Thread Gabor Grothendieck
On Mon, May 9, 2011 at 10:20 AM, Nicole Gross-Camp n.gross-c...@uea.ac.uk wrote: I have what I hope is a simple question - is it possible to do time series analysis on a small data set specifically only four data points? I have collected human threat data (mean number of threats per

Re: [R] Round down to earliest hour or half hour

2011-05-09 Thread Jeff Newmiller
One way, assuming your timestamps are POSIXct format: truncInterval - function ( x, dx=as.difftime(1,units=days) ) { xn - as.numeric( x ) result - xn - xn %% as.numeric( dx, units=secs ) class( result ) - 'POSIXct' result } truncInterval( as.POSIXct(c(2011-04-28 09:20:00, 2011-04-28 09:40:00)),

[R] Approximate name matching

2011-05-09 Thread Stavros Macrakis
Is there R software available for doing approximate matching of personal names? I have data about the same people produced by different organizations and the only matching key I have is the name. I know that commercial solutions exist, and I know I code code this from scratch, but I'd prefer to

Re: [R] Vectorizing a function: what does it mean?

2011-05-09 Thread Duncan Murdoch
On 09/05/2011 1:31 PM, David Winsemius wrote: On May 9, 2011, at 11:57 AM, Ron Michael wrote: Dear all, I would really appreciate if somebody can help me to understand what does the phrase Vectorize your function mean? And what is the job of Vectorize() function in doing that? I have read

Re: [R] Vectorizing a function: what does it mean?

2011-05-09 Thread Duncan Murdoch
On 09/05/2011 11:57 AM, Ron Michael wrote: Dear all, I would really appreciate if somebody can help me to understand what does the phrase Vectorize your function mean? And what is the job of Vectorize() function in doing that? I have read many threads where experts suggest to Vectorize the

[R] Setting NA to blank

2011-05-09 Thread Dat Mai
Hey All, I have a matrix m, and I wish to set all the NA values to blank. How would I do so? -- Best, Dat Mai PhD Rotation Student Albert Einstein College of Medicine [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] How to alter circle size

2011-05-09 Thread Deepayan Sarkar
On Mon, May 9, 2011 at 8:23 PM, Dat Mai dat.d@gmail.com wrote: Thanks for the help! Though, when I do this, I get a message saying Error using packet 1 value where TRUE/FALSE. Would that have anything to do with this set of code? It might. (As we don't know what you did, we can't really

Re: [R] How to alter circle size

2011-05-09 Thread Dat Mai
All right then--I shall get bash away. Thanks a lot. On Mon, May 9, 2011 at 2:55 PM, Deepayan Sarkar deepayan.sar...@gmail.comwrote: On Mon, May 9, 2011 at 8:23 PM, Dat Mai dat.d@gmail.com wrote: Thanks for the help! Though, when I do this, I get a message saying Error using packet 1

Re: [R] Create subsets of data

2011-05-09 Thread Steve Lianoglou
Hi, On Mon, May 9, 2011 at 9:40 AM, Pavan G pavan.n...@gmail.com wrote: Hello All, Let's say I have points on a x-y plane. x ranges from 0-2 and y from 0-2. There are points in quadrants x[0:1]---y[0:1] and in x[1:2]y[1:2]. I would like to get the mean and std of the points in the

Re: [R] Setting NA to blank

2011-05-09 Thread John Kane
(mat - matrix(c(1,2,3,NA),2)) mat[is.na(mat)] - mat But if you have a numerical matrix it coverts the matrix to character. --- On Mon, 5/9/11, Dat Mai dat.d@gmail.com wrote: From: Dat Mai dat.d@gmail.com Subject: [R] Setting NA to blank To: r-help@r-project.org Received:

Re: [R] Using NULL to my data?

2011-05-09 Thread Nilza BARROS
Dear Gabor, Thanks for your help. I was trying to do what you ask me and I've found the solution. with(teste,sprintf(INSERT INTO OBS (date,T_2M,TMAX_2M,TMIN_2M) VALUES (%s, %5.2f, %5.2f, %5.2f,%s),date2,T_2M,TMAX_2M,TMIN_2M,Station_NO)) Error in sprintf(INSERT INTO OBS

Re: [R] Create subsets of data

2011-05-09 Thread David Winsemius
On May 9, 2011, at 9:40 AM, Pavan G wrote: Hello All, Let's say I have points on a x-y plane. x ranges from 0-2 and y from 0-2. There are points in quadrants x[0:1]---y[0:1] and in x[1:2] y[1:2]. I would like to get the mean and std of the points in the x[0:1] y[0:1] quadrant

Re: [R] Setting NA to blank

2011-05-09 Thread Dat Mai
Thank you kind sir! On Mon, May 9, 2011 at 3:25 PM, John Kane jrkrid...@yahoo.ca wrote: (mat - matrix(c(1,2,3,NA),2)) mat[is.na(mat)] - mat But if you have a numerical matrix it coverts the matrix to character. --- On Mon, 5/9/11, Dat Mai dat.d@gmail.com wrote: From: Dat Mai

Re: [R] Create subsets of data

2011-05-09 Thread David Winsemius
On May 9, 2011, at 3:46 PM, David Winsemius wrote: On May 9, 2011, at 9:40 AM, Pavan G wrote: Hello All, Let's say I have points on a x-y plane. x ranges from 0-2 and y from 0-2. There are points in quadrants x[0:1]---y[0:1] and in x[1:2] y[1:2]. I would like to get the mean and std

Re: [R] Setting NA to blank

2011-05-09 Thread Ted Harding
John Kane's reply sums it up! (Though you could use , instead of , which would give you an empty string instead of the space character; but the resulting matrix would still consist entirely of character elements). However, the real reason I am following up is to ask why you want the blank

Re: [R] Averaging uneven measurements by time with uneven numbers of measurements

2011-05-09 Thread Adele_Thompson
An easy way to average every 30 minutes is using the aggregate function. First I use the mod (%%) to get times as the next earliest possible 30 min time increment. bTime- as.POSIXct(c( 2011-04-28 09:02:00 CDT,2011-04-28 09:02:00 CDT,2011-04-28 09:12:00 CDT,2011-04-28 09:14:00 CDT,2011-04-28

Re: [R] interrupted time series analysis using ARIMA models

2011-05-09 Thread jpehsani
Hi Berta, Did you have any luck finding code for the gradual permanent impact intervention? I am trying to fit two types of intervention effects for two different models - a gradual and a sudden impact effect - and unable to find any code on how to do this. thanks Jon -- View this message in

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-09 Thread Alex Olssen
Wow that is really interesting, Sorry I was asleep when you emailed these. And yes, of course, I had been trying to implement model 18, not 18s, that was a typo, sorry. I will have a look at the code you posted. Thanks, Alex On 10 May 2011 02:18, peter dalgaard pda...@gmail.com wrote: Hmm,

Re: [R] interrupted time series analysis using ARIMA models

2011-05-09 Thread Roy Mendelssohn
Look at: de Jong, P. and Penzer, J. (1998) Diagnosing shocks in time series. Journal of the American Statistical Association. 93, 796-806. A pdf is available at: http://stats.lse.ac.uk/penzer/publications.html -Roy M. On May 9, 2011, at 1:32 PM, jpehsani wrote: Hi Berta, Did you have

[R] Creating Observation ID

2011-05-09 Thread Robert Baer
If I have a data frame something like: Value=rnorm(30) Group = sample(c('A','B','C'), 30, replace=TRUE) df = data.frame(Value, Group) It seems like it should be simple to create an 'ObsID' column which indicates the observation order of each Value within each of the 3 groups. Somehow, I can't

Re: [R] Creating Observation ID

2011-05-09 Thread William Dunlap
Does the following work for you? df2 - transform(df, ObsID=ave(rep(0,length(Group)), Group, FUN=seq_along)) head(df2) Value Group ObsID 1 -0.0025132 B 1 2 -1.2456156 A 1 3 -2.0531704 B 2 4 1.5861770 B 3 5 0.1900908 A 2 6 0.7197067 B

Re: [R] Setting NA to blank

2011-05-09 Thread Dat Mai
I asked because I thought it'd solve an issue I had. I was actually being quite rash in asking this question and for that, I apologize. I wanted to know because I was attempting to create a heatmap where the NA values would not be shown while all the outputs with actual numerical value will be

[R] Help with options(contrasts)

2011-05-09 Thread Axel Urbiz
Dear list, Is it possible to specify a contrast in options() that would create an identity matrix for each factor in the model matrix? For example, for each factor in 'dd' below, I can create an identity matrix using contrasts = FALSE. Is it possible to set this in options(), so when I create a

Re: [R] Stirlings Approximation

2011-05-09 Thread Jim Silverton
I have some big combinations like: choose 784645433 Can R compute these? Is there any package that does stirlings approximation in R? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Stirlings Approximation

2011-05-09 Thread Kjetil Halvorsen
?lchoose ?lgamma ?lfactorial On Mon, May 9, 2011 at 7:45 PM, Jim Silverton jim.silver...@gmail.com wrote: I have some big combinations like: choose 784645433 Can R compute these? Is there any package that does stirlings approximation in R? -- Thanks, Jim.  

[R] Filtering out bad data points

2011-05-09 Thread Robert A'gata
Hi, I always have a question about how to do this best in R. I have a data frame and a set of criteria to filter points out. My procedure is to always locate indices of those points, check if index vector length is greater than 0 or not and then remove them. Meaning dftest -

Re: [R] Filtering out bad data points

2011-05-09 Thread Bill.Venables
You could use a function to do the job: withinRange - function(x, r = quantile(x, c(0.05, 0.95))) x = r[1] x = r[2] dtest2 - subset(dftest, withinRange(x)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Robert A'gata Sent:

Re: [R] Fortran Symbol Name not in Load Table

2011-05-09 Thread vioravis
I used the DLL export viewer to what is the table name being exported. It is showing as VALUEAHROPTIMIZE_. This is the name of the function we have used plus the underscore. Is there any other reason for the function not getting recognized??? Thanks. -- View this message in context:

[R] Lattice: splom plots for different factors with correlation in lower.panel

2011-05-09 Thread Tom Porteus
Hello list, I am looking to create a figure for my dataset using splom, where there is a splom subplot for each level of a factor within, for example, a 2x2 layout. For each subplot, I wish to put the r-value between each variable pair in the lower panel. The code I have thus far is below, using

Re: [R] Creating Observation ID

2011-05-09 Thread Bill.Venables
Here is one way: df - data.frame(Value = rnorm(30), Group = sample(c('A','B','C'), 30, replace = TRUE)) ## make a little function to do the job iNumber - function(f) { f - as.factor(f) X - outer(f, levels(f), ==)+0 rowSums(X * apply(X, 2, cumsum)) } ##

[R] Reading a large netCDF file using R

2011-05-09 Thread sulochandhungel
I got a netCDF file from a climate group and wanted to aggregate the data. The file summary looks like this library(ncdf) nc=open.ncdf(NCEP_prec_1949_58.nc) nc [1] file NCEP_prec_1949_58.nc has 4 dimensions: [1] Time Size: 14608 [1] lat Size: 99 [1] lon Size: 199 [1] DateStrLen Size: 20

[R] Question Using Old R Packages

2011-05-09 Thread c.hulmelowe
I'm trying to use the package rgl for a research project. I've used it in the past, but now when I try to re-install it after updating to R 2.13.0 I'm getting the following error: Warning in install.packages : package ‘rgl’ is not available (for R version 2.13.0) Is there any way to get R to

Re: [R] Question Using Old R Packages

2011-05-09 Thread c.hulmelowe
In case anyone else is having similar problems, it turns out it may have been an issue with the interface I was using (R Studio). When I close R Studio and tried it again through R it installed without the error message. Chris. -- View this message in context:

Re: [R] save and load user modifications of options

2011-05-09 Thread xue wang
Thanks David! I got a solution, though maybe not optimal. In the zzz.r file of the R package, I include the folloing code: .onLoad - function(libname,pkgname) { myoptions - list(ngs.python=sage -python,ngs.macs=macs14) if(exists(myoptions,.GlobalEnv))

[R] Saving multiple 3x3 TIFF graphics inside a loop

2011-05-09 Thread John S
Dear Friends, I have been trying to save multiple 3x3 (mfrow=c(3,3) graphics inside a loop using tiff figure format (not using PDF or savePlot functions) with no success. Could you please help? Here is a simplified example code: dat=data.frame

[R] SQP with Constraints

2011-05-09 Thread vioravis
I am trying to optimize function similar to the following: Minimize x1^2 - x2^2 - x3^2 st x1 x2 x2 x3 The constraint is that the variables should be monotonically increasing. Is there any package that implements Sequential Quadratic Programming with ability include these constraints???

Re: [R] SQP with Constraints

2011-05-09 Thread Ravi Varadhan
Look at the solve.QP() function in the quadprog package. Ravi. From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of vioravis [viora...@gmail.com] Sent: Monday, May 09, 2011 10:46 PM To: r-help@r-project.org Subject: [R] SQP

[R] Weird read.xls behavior

2011-05-09 Thread Jun Shen
Dear list, I used read.xls to read in an excel file, which has both character and numeric columns. Everything seems fine except in the last column, I have this character value ng/ml. When reading in, read.xls seems to add a space at the end of it, became ng/ml . How can I prevent read.xls doing

Re: [R] Weird read.xls behavior

2011-05-09 Thread Kenneth Roy Cabrera Torres
Maybe in the original there are some ghost spaces after ng/ml, verify them. Any way you can erase the first and the last white spaces with gsub function. HTH Kenneth El lun, 09-05-2011 a las 22:44 -0500, Jun Shen escribió: Dear list, I used read.xls to read in an excel file, which has both

  1   2   >