Re: [R] EVENT PACKAGE

2010-06-24 Thread Dennis Murphy
Hi: Perhaps the OP is referring to Jim Lindsey's event package, which is not on CRAN but available at http://www.commanster.eu/rcode.html HTH, Dennis On Wed, Jun 23, 2010 at 3:11 AM, Jim Lemon j...@bitwrit.com.au wrote: On 06/23/2010 02:10 AM, Pedro Mota Veiga wrote: Hi people of R forum,

[R] how to change the format of numeric variable

2010-06-24 Thread Yi
Hi, The format problem is really annoying. How to get rid of it? x [1] 1e+06 And also when I do barplot, x=rnorm(100,mean=1000) barplot(table(cut(x,breaks=c(0,50,100,150,200,250,300,350,400,450,500,1000,2000,5000,1 The data will show as scientific format, when it is larger than 999

Re: [R] xyplot: adding pooled regression lines to a paneled type=r plot

2010-06-24 Thread Dennis Murphy
Hi: Does this work for you? xyplot(distance ~ age | Sex, data = Orthodont, groups = Subject, main = 'Individual linear regressions ~ age', type = c('g', 'r'), panel = function(x, y, ...) { panel.xyplot(x, y, ..., col = gray(0.5)) panel.lmline(x,

[R] Question on WLS (gls vs lm)

2010-06-24 Thread Stats Wolf
Hi all, I understand that gls() uses generalized least squares, but I thought that maybe optimum weights from gls might be used as weights in lm (as shown below), but apparently this is not the case. See: library(nlme) f1 - gls(Petal.Width ~ Species / Petal.Length, data = iris, weights =

Re: [R] Estimate of variance and prediction for multiple linear regression

2010-06-24 Thread Gavin Simpson
On Wed, 2010-06-23 at 16:30 -0700, cc super wrote: What if the size of the newdata is different from the previous one used to generate the regression model? Let's say pdat - data.frame(x1 = rnorm(5, 2), x2 = rnorm(5)) predict(lin, pdat) It comes up with warning and the result is not

Re: [R] Unique Data Frame Name?

2010-06-24 Thread Dennis Murphy
Hi: Try this: for (i in 1:2) { + x=c(1,2,3,4) + y=c(10,20,30,40) + G - paste(name, i, sep=) + assign(G, data.frame(x,y)) + } name1 x y 1 1 10 2 2 20 3 3 30 4 4 40 name2 x y 1 1 10 2 2 20 3 3 30 4 4 40 HTH, Dennis On Wed, Jun 23, 2010 at 3:56 PM, Douglas M.

Re: [R] Plotrix Trick

2010-06-24 Thread Hrishi Mittal
Lorenzo, This is a bit ugly but should work. Instead of using plotrix's show.values, use the text() command: for(i in 1:5) { for(j in 1:5) { text(i-0.5,j-0.5,format(A[6-j,i],digits=3),col=white) } } -- View this message in context:

Re: [R] Plotting Data on a Map

2010-06-24 Thread Brandon Hurr
Upload it to GoogleDocs http://docs.google.com or Dropboxhttp://dropbox.comand give us a public link to the dataset. HTH, Brandon On Wed, Jun 23, 2010 at 21:57, Felipe Carrillo mazatlanmex...@yahoo.comwrote: For some reason the shapefile can't get attached. The shapefile is too large to put

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-24 Thread Atte Tenkanen
PS. Mayby I can somehow try to transform data and check it, for example, using the skewness-function of timeDate-package? Thanks. What I have had to ask is that how do you test that the data is symmetric enough? If it is not, is it ok to use some data transformation? when it is said:

Re: [R] problem to building R (datasets)

2010-06-24 Thread Geun Seop Lee
Thank you. I finally found what was the problem. By mistake, I compiled with different version of MinGW compiler. I heard that new MinGw compiler does not support _Unwind_ kinds of functions anymore. Thank you again. Lee. On Wed, Jun 23, 2010 at 7:30 PM, Geun Seop Lee clarmas...@gmail.com

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-24 Thread Atte Tenkanen
Thanks. What I have had to ask is that how do you test that the data is symmetric enough? If it is not, is it ok to use some data transformation? when it is said: The Wilcoxon signed rank test does not assume that the data are sampled from a Gaussian distribution. However it does assume that

[R] Odp: how to change the format of numeric variable

2010-06-24 Thread Petr PIKAL
Hi see ?options and scipen parameter e.g. options(scipen=9) Regards Petr r-help-boun...@r-project.org napsal dne 24.06.2010 08:39:29: Hi, The format problem is really annoying. How to get rid of it? x [1] 1e+06 And also when I do barplot, x=rnorm(100,mean=1000)

Re: [R] which model suits for these kind of data

2010-06-24 Thread vijaysheegi
Hi , i am trying to install tseries packages from local drive.i am getting .Please advise I am getting this errror Please advise utils:::menuInstallLocal() Error in gzfile(file, r) : cannot open the connection In addition: Warning message: In gzfile(file, r) : cannot open compressed file

[R] two sample binomial test

2010-06-24 Thread associatedboy
I wanted to know if there is a way to perform a two sample binomial test in R. I know you can use the proportion test i.e.: prop.test(c(19,5),c(53,39),p=NULL,alternative=two.sided). But I was looking to use the exact binomial test, binom.test, however when I have tried replacing prop.test with

[R] Correctly plotting bar and scatter chart on 2-y axis plot with par(new=T)

2010-06-24 Thread dan.weavesham
Hello Nabble users, A question about having two y axes on a chart. I'm trying to show on the left (first) y axis a measure used in an experiment; the x axis shows the experiment number, that has been sorted in a specific manner -- i.e. not Experiments 1,2,3,n, but could be Experiment 6,1,18,n;

[R] Multivariate Binomial distribution

2010-06-24 Thread Bogaso Christofer
Dear all, is there any R implementation on the Multivariate binomial distribution like calculate the value of p.m.f., drawing random sample from it etc. Thanks, [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Odp: Correctly plotting bar and scatter chart on 2-y axis plot with par(new=T)

2010-06-24 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 24.06.2010 09:44:49: Hello Nabble users, A question about having two y axes on a chart. I'm trying to show on the left (first) y axis a measure used in an experiment; the x axis shows the experiment number, that has been sorted in a specific

Re: [R] count data with a specific range

2010-06-24 Thread Joris Meys
see ?levels eg: x - rnorm(10) y - cut(x,c(-10,0,10)) levels(y)-c(-10-0,0-10) cheers Joris On Thu, Jun 24, 2010 at 4:14 AM, Yi liuyi.fe...@gmail.com wrote: Yeap. It works. Just to make the result more beautiful. One more question. The interval is showns as (0,10]. Is there a way to change

Re: [R] xyplot: adding pooled regression lines to a paneled type=r plot

2010-06-24 Thread Deepayan Sarkar
On Wed, Jun 23, 2010 at 11:35 PM, Michael Friendly frien...@yorku.ca wrote: Thanks, Deepayan I read your presentation and understand how this works for the case you presented, but I can't get it to work for my case, where I want to superimpose model fitted lines over individual subject

[R] Snowfall: cannont open connection problem

2010-06-24 Thread Edmond.Ng
Dear R-listers, I have been using Snowfall (version 1.84) for parallel computing on a quad-PC running Windows 7 for a month or so without much problem. I started having problems runnnig R with Snowfall over our network when a new Novell client was installed for Windows 7. I experinenced

Re: [R] two sample binomial test

2010-06-24 Thread Ted Harding
On 24-Jun-10 06:36:39, associatedboy wrote: I wanted to know if there is a way to perform a two sample binomial test in R. I know you can use the proportion test i.e.: prop.test(c(19,5),c(53,39),p=NULL,alternative=two.sided). But I was looking to use the exact binomial test, binom.test,

Re: [R] Plotrix Trick

2010-06-24 Thread Jan van der Laan
Lorenzo, You can also use a custom colorscale using color.scale and the cellcolors option of color2D.matplot: pdf(test_color_scale_logcolor.pdf) oldpar-par( mar = c(4.5,5, 2, 1) + 0.1, cex.axis=1.4,cex.lab=1.6,cex.main=1.6) cellcolors - color.scale(log(A),c(0.2,1),c(0.2,0.5),c(0,0))

[R] sobel.lme

2010-06-24 Thread Sebastian Stegmann
Dear R-community, I am just conducting various mediation analyses with data from individual participants who are nested in teams. I found the “sobel.lme” function to be pretty helpful when doing so. (A big thank you to Paul Bliese for his multilevel-package and the awesome manual!) Here’s the

Re: [R] Question on WLS (gls vs lm)

2010-06-24 Thread Joris Meys
Isn't that exactly what you would expect when using a _generalized_ least squares compared to a normal least squares? GLS is not the same as WLS. http://www.aiaccess.net/English/Glossaries/GlosMod/e_gm_least_squares_generalized.htm Cheers Joris On Thu, Jun 24, 2010 at 9:16 AM, Stats Wolf

Re: [R] Question on WLS (gls vs lm)

2010-06-24 Thread Stats Wolf
Thanks for reply. Yes, they do differ, but does not gls() with the weights argument (correlation being unchanged) make the special version of GLS, as this sentence from the page you provided says: The method leading to this result is called Generalized Least Squares estimation (GLS), of which WLS

[R] Snowfall: cannont open connection problem (repost in plain text)

2010-06-24 Thread Edmond.Ng
Apologies for posting my question in HTML earlier. Reposted in plain text now. Dear R-listers, I have been using Snowfall (version 1.84) for parallel computing on a quad-PC running Windows 7 for a month or so without much problem. I started having problems runnnig R with Snowfall over our

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-24 Thread Joris Meys
One way of looking at it is doing a sign test after substraction of the mean. For symmetrical data sets, E[X-mean(X)] = 0, so you expect to have about as many values above as below zero. There is a sign test somewhere in one of the packages, but it's easily done using the binom.test as well :

[R] ?to calculate sth for groups defined between points in one variable (string), / value separating/ spliting variable into groups by i.e. between start, NA, NA, stop1, start2, NA, stop2

2010-06-24 Thread Eugeniusz Kaluza
Dear useRs, Thanks for any advices # I do not know where are the examples how to mark groups # based on signal occurence in the additional variable: cf. variable c2, # How to calculate different calculations for groups defined by (split by occurence of c2 characteristic data) #First

Re: [R] Analyzing large transition matrix

2010-06-24 Thread Jim Lemon
On 06/23/2010 11:30 PM, Bill Harris wrote: Let's say you have a dataframe of car trade-ins. For example, each row contains oldcar newcar qty and a typical entry could be lexus bmw1 I put the qty column to allow for fleet purchases, where one purchase may convert multiple cars at

Re: [R] which model suits for these kind of data

2010-06-24 Thread Uwe Ligges
You are probably under Windows. The Menu to install from local zip files implies you specify a precompiled binary package. Uwe Ligges On 24.06.2010 06:12, vijaysheegi wrote: Hi , i am trying to install tseries packages from local drive.i am getting .Please advise I am getting this errror

Re: [R] Analyzing large transition matrix

2010-06-24 Thread John Kane
--- On Thu, 6/24/10, Jim Lemon j...@bitwrit.com.au wrote: From: Jim Lemon j...@bitwrit.com.au Subject: Re: [R] Analyzing large transition matrix To: Bill Harris bill_har...@facilitatedsystems.com Cc: r-help r-help@r-project.org Received: Thursday, June 24, 2010, 7:44 AM On 06/23/2010

Re: [R] Generalised Estimating Equations on approx normal outcome with limited range

2010-06-24 Thread Søren Højsgaard
Hi, 1) There is no feature in geeglm for that sort of truncation of the outcome. 2) It is generally fragile - and not recommendable - to use corstr=unstructured in geeglm. Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org]

Re: [R] A question about R2Winbugs

2010-06-24 Thread Uwe Ligges
Hi, perhaps you can send X.csv in a private message. It is easier to have a reproducible example than reading the code line by line. Best, Uwe Ligges On 24.06.2010 00:27, Dennis wrote: Dear R users: I was trying to fit a HMM with mixture of Gaussian into the dataset, and I tried to

Re: [R] Question on WLS (gls vs lm)

2010-06-24 Thread Joris Meys
Indeed, WLS is a special case of GLS, where the error covariance matrix is a diagonal matrix. OLS is a special case of GLS, where the error is considered homoscedastic and all weights are equal to 1. And I now realized that the varIdent() indeed makes a diagonal covariance matrix, so the results

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-24 Thread Muenchen, Robert A (Bob)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dr. David Kirkby Sent: Tuesday, June 22, 2010 7:49 PM To: r-help@r-project.org Subject: Re: [R] Popularity of R, SAS, SPSS, Stata... ... I don't know how practical it is with R, but

Re: [R] Question on WLS (gls vs lm)

2010-06-24 Thread Stats Wolf
Indeed, they should give the same results, and hence I was worried to see that the results were not that same. Suffice it to look at standard errors and p-values: they do differ, and the differences are not really that small. Thanks, Stats Wolf On Thu, Jun 24, 2010 at 2:39 PM, Joris Meys

[R] boxplot width

2010-06-24 Thread nana
Hi everyone, I made this set of boxplots that would show me the widths of some sites broken up by some chromosome, but I don't know how to make it indicate the number of data points that created the boxplot. How do I do that? boxplot(data$site~data$chr,varwidth='TRUE') -- View this message

[R] Averaging half hourly data to hourly

2010-06-24 Thread Jennifer Wright
Hi all, I have some time-series data in half hourly time steps and I want to be able to either average or sum the two half hours together into hours. Any help greatly appreciated. Thanks, Jenny -- The University of Edinburgh is a charitable body, registered in Scotland, with registration

Re: [R] is there a Decode HTML function somewhere (similar to URLdecode)?

2010-06-24 Thread Tony Breyal
(I've just realised that the example above might not be clear when viewed in a browser) So just to clarify, I would like to convert HTML entities into the ASCII equivalent using R, saving the results to a plain text file. For example: x - paste(i, s, n, , a, p, o, s, ;, t, sep = ) would become

[R] How to say if error

2010-06-24 Thread Paul Chatfield
Hi - I am looping over a structural equation model for a variety of datasets. Occasionally, the model returns an error and the loop then breaks. I'd like to set a condition which says something like if error, then print NAs rather than the loop breaking, but I don't know how to say if error.

Re: [R] How to say if error

2010-06-24 Thread Roman Luštrik
I'm sorry, I don't understand your problem to the detail so my suggestion may be waaay off, but how's this? You can see in vector vec - all ok values except where there's an error. n - 10 vec - rep(NA, n) for (j in 1:n) {tryCatch(ifelse(j==5, vec[j] - j, j), finally=print(oh dear))} vec

[R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-24 Thread gokhanocakoglu
I am studying on statistical shape analysis, I wonder is there any way or package available that I can perform Euclidean Distance Matrix Analysis (EDMA I or EDMA II) in R... thanks Gokhan -- View this message in context:

Re: [R] How to say if error

2010-06-24 Thread Roman Luštrik
Does ?tryCatch do what you want? -- View this message in context: http://r.789695.n4.nabble.com/How-to-say-if-error-tp2266619p2266749.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] How to say if error

2010-06-24 Thread Paul Chatfield
I've had a look at the conditions in base and I can't get the ones to work I've looked at but it is all new to me. For example, I can work the examples for tryCatch, but it won't print a finally message for me when I apply it to my model. Even if I could get this to work, I think it would

Re: [R] boxplot width

2010-06-24 Thread Tal Galili
Does: boxplot(data$site~data$chr, varwidth=TRUE) (notice I removed the ' ' from the 'TRUE') Work ? Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) |

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-24 Thread Tal Galili
Isn't this what ?dist Does ? Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English)

Re: [R] How to say if error

2010-06-24 Thread Paul Chatfield
Thanks Roman - you're right it can do more than I thought. We're close now to solving it I feel. Essentially I'm trying to get the code below to work. If the condition is satisfied, it prints 2, but it doesn't save it in z. I want it to save it even though there's an error. Perhaps you can

Re: [R] integrate dmvtnorm

2010-06-24 Thread Christos Argyropoulos
Carrie, According to the help file for the function integrate,  the integrand 'f': must accept a vector of inputs and produce a vector of function evaluations at those points.  The ‘Vectorize’ function may be helpful to convert ‘f’ to this form. The integrate function wraps

Re: [R] Question on WLS (gls vs lm)

2010-06-24 Thread Viechtbauer Wolfgang (STAT)
The weights in 'aa' are the inverse standard deviations. But you want to use the inverse variances as the weights: aa - (attributes(summary(f1)$modelStruct$varStruct)$weights)^2 And then the results are essentially identical. Best, -- Wolfgang Viechtbauer

Re: [R] recurrent events data analysis

2010-06-24 Thread אבי
__ Information from ESET NOD32 Antivirus, version of virus signature database 5224 (20100624) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Analyzing large transition matrix

2010-06-24 Thread Bill Harris
Thanks, John and Jim. In general, the problem is the large number of entries, as you said (I could use up a lot of ink in a large-format plotter, I guess). Someone has suggested a pivot table in Excel :-) which makes me realize that I need to learn the reshape and plyr packages immediately. The

Re: [R] ?to calculate sth for groups defined between points in one variable (string), / value separating/ spliting variable into groups by i.e. between start, NA, NA, stop1, start2, NA, stop2

2010-06-24 Thread Joris Meys
On Thu, Jun 24, 2010 at 1:18 PM, Eugeniusz Kaluza eugeniusz.kal...@polsl.pl wrote: Dear useRs, Thanks for any advices # I do not know where are the examples how to mark groups #  based on signal occurence in the additional variable: cf. variable c2, # How to calculate different

Re: [R] boxplot width

2010-06-24 Thread nana
it works with the 'TRUE' as well but this only shows me the boxplots width; it doesn't show me the number of data points used though.. This is what I can't figure out -- View this message in context: http://r.789695.n4.nabble.com/boxplot-width-tp2266805p2266932.html Sent from the R help mailing

Re: [R] How to say if error

2010-06-24 Thread Duncan Murdoch
On 24/06/2010 7:06 AM, Paul Chatfield wrote: I've had a look at the conditions in base and I can't get the ones to work I've looked at but it is all new to me. For example, I can work the examples for tryCatch, but it won't print a finally message for me when I apply it to my model. Even if

Re: [R] Question on WLS (gls vs lm)

2010-06-24 Thread Joris Meys
Thanks! I was getting confused as wel, Wolf really had a point. I have to admit that this is all a bit counterintuitive. I would expect those weights to be the inverse of the variances, as GLS uses the inverse of the variance-covariance matrix. I finally found in the help files ?nlme::varWeights

Re: [R] boxplot width

2010-06-24 Thread David Winsemius
On Jun 24, 2010, at 7:45 AM, nana wrote: Hi everyone, I made this set of boxplots that would show me the widths of some sites broken up by some chromosome, but I don't know how to make it indicate the number of data points that created the boxplot. How do I do that?

Re: [R] How to say if error

2010-06-24 Thread Joris Meys
An old-fashioned and I guess also advised-against method would be to use try() itself, eg : set.seed(1) x - rnorm(1:10) y - letters[1:10] z - rnorm(1:10) for (i in list(x,y,z)){ cc - try(sum(i), silent=T) if(is(cc,try-error)) {next} print(cc) } Put silent=F if you want to see the error

Re: [R] boxplot width

2010-06-24 Thread Hrishi Mittal
nana, If you save the boxplot as an R object, you can access various parameters of the resulting plot. Since we don't have your data, I'll give you an example with the preloaded ToothGrowth dataset: ToothGrowth-y b-boxplot(y$len~y$dose,xaxt=n) Now, if you type b at the R prompt, you will see

Re: [R] boxplot width

2010-06-24 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 24.06.2010 15:18:39: it works with the 'TRUE' as well but this only shows me the boxplots width; it doesn't show me the number of data points used though.. This is what I can't figure out Save your boxplot call to same object bbb -

Re: [R] is there a Decode HTML function somewhere (similar to URLdecode)?

2010-06-24 Thread Henrique Dallazuanna
Try this: library(XML) xmlValue(getNodeSet(htmlParse(x, asText = TRUE), //p)[[1]]) On Thu, Jun 24, 2010 at 6:53 AM, Tony Breyal tony.bre...@googlemail.comwrote: (I've just realised that the example above might not be clear when viewed in a browser) So just to clarify, I would like to

[R] If-error-resume-next

2010-06-24 Thread Christofer Bogaso
In VBA there is a syntax if error resume next which sometimes acts as very beneficial on ignoring error. Is there any similar kind of function/syntax here in R as well? Thanks for your attention [[alternative HTML version deleted]] __

Re: [R] RJDBC vs RMySQL vs ???

2010-06-24 Thread James W. MacDonald
Hi Ralf, Ralf B wrote: Sorry for the lack of details. Since I run the same SQL first directly on MySQL (using the MySQL Query Browser) and then again using R through the RJDBC interface, I assume that I won't simply have a badly constructed SQL query. However, just to clear possible objection,

Re: [R] If-error-resume-next

2010-06-24 Thread Chuck Cleland
On 6/24/2010 10:30 AM, Christofer Bogaso wrote: In VBA there is a syntax if error resume next which sometimes acts as very beneficial on ignoring error. Is there any similar kind of function/syntax here in R as well? ?try Thanks for your attention [[alternative HTML version

Re: [R] How to say if error

2010-06-24 Thread Paul Chatfield
That's great. That solves it. I can work on eloquence later :) I just to sort out that model problem: dof-numeric(10) for (i in 1:10){ x-rnorm(i-1);y-rnorm(i-1) cc - try(lm(y~x), silent=T) if(is(cc,try-error)) {dof[i]-NA} else

Re: [R] boxplot width

2010-06-24 Thread nana
Thank you. It worked. Regards -- View this message in context: http://r.789695.n4.nabble.com/boxplot-width-tp2266805p2267050.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] If-error-resume-next

2010-06-24 Thread Joris Meys
http://r.789695.n4.nabble.com/How-to-say-if-error-td2266619.html#a2266619 Cheers On Thu, Jun 24, 2010 at 4:30 PM, Christofer Bogaso bogaso.christo...@gmail.com wrote: In VBA there is a syntax if error resume next which sometimes acts as very beneficial on ignoring error. Is there any similar

Re: [R] Averaging half hourly data to hourly

2010-06-24 Thread Joris Meys
See ?aggregate Cheers J On Thu, Jun 24, 2010 at 10:45 AM, Jennifer Wright j.wright...@sms.ed.ac.uk wrote: Hi all, I have some time-series data in half hourly time steps and I want to be able to either average or sum the two half hours together into hours. Any help greatly appreciated.

Re: [R] is there a Decode HTML function somewhere (similar to URLdecode)?

2010-06-24 Thread Tony Breyal
Thank you kindly Henrique, that works perfectly for me. On 24 June 2010 15:25, Henrique Dallazuanna www...@gmail.com wrote: Try this: library(XML) xmlValue(getNodeSet(htmlParse(x, asText = TRUE), //p)[[1]]) On Thu, Jun 24, 2010 at 6:53 AM, Tony Breyal tony.bre...@googlemail.com wrote:

[R] PD: ?to calculate sth for groups defined between points in one variable (string), / value separating/ spliting variable into groups by i.e. between start, NA, NA, stop1, start2, NA, stop2

2010-06-24 Thread Eugeniusz Kałuża
Dear useRs, Thanks for advice from Joris Meys, Now will try to think how to make it working for less specyfic case, to make the problem more general. Then the result should be displayed for every group between non empty string in c2 i.e. not only result for: #mean: c1 c3c4

Re: [R] RJDBC vs RMySQL vs ???

2010-06-24 Thread Ralf B
Unfortunately, I have a lot of errors with RMySQL -- but that is another thread... Ralf On Thu, Jun 24, 2010 at 10:31 AM, James W. MacDonald jmac...@med.umich.edu wrote: Hi Ralf, Ralf B wrote: Sorry for the lack of details. Since I run the same SQL first directly on MySQL (using the MySQL

Re: [R] How to say if error

2010-06-24 Thread Paul Chatfield
On a similar issue, how can you detect a warning in a loop - e.g. the following gives a warning, so I'd like to set up code to recognise that and then carry on in a loop x-rnorm(2);y-c(1,0) ff-glm(y/23~x, family=binomial) so this would be incorporated into a loop that might be

Re: [R] How to say if error

2010-06-24 Thread Joris Meys
You could do that using the options, eg : set.seed(1) x - rnorm(1:10) y - letters[1:10] z - rnorm(1:10) warn -getOption(warn) options(warn=2) for (i in list(x,y,z)){ cc - try(mean(i), silent=T) if(is(cc,try-error)) {next} print(cc) } options(warn=warn) see ?options under warn Cheers

[R] Plotrix Trick

2010-06-24 Thread Lorenzo Isella
Dear Hrishi, I am almost there, thanks. The only small problem left is to convince also the colorbar to plot the values I want. Consider the small snippet at the end of the email: colors and numbers inside the cells are OK, but the legend shows the extremes of the log transformed data instead of

Re: [R] PD: ?to calculate sth for groups defined between points in one variable (string), / value separating/ spliting variable into groups by i.e. between start, NA, NA, stop1, start2, NA, stop2

2010-06-24 Thread Joris Meys
Same trick : c0-rbind( 1, 2 , 3, 4, 5, 6, 7, 8, 9,10,11, 12,13,14,15,16,17 ) c0 c1-rbind(10, 20 ,30,40, 50,10,60,20,30,40,50, 30,10, 0,NA,20,10.3444) c1 c2-rbind(NA,A,NA,NA,B,NA,NA,NA,NA,NA,NA,C,NA,NA,NA,NA,D) c2 C.df-data.frame(c0,c1,c2) C.df pos -

Re: [R] Comparing distributions

2010-06-24 Thread Greg Snow
If you want a more objective eye-ball test, look at: Buja, A., Cook, D. Hofmann, H., Lawrence, M. Lee, E.-K., Swayne, D.F and Wickham, H. (2009) Statistical Inference for exploratory data analysis and model diagnostics Phil. Trans. R. Soc. A 2009 367, 4361-4383 doi:

Re: [R] Plotrix Trick

2010-06-24 Thread David Winsemius
On Jun 24, 2010, at 11:38 AM, Lorenzo Isella wrote: Dear Hrishi, I am almost there, thanks. The only small problem left is to convince also the colorbar to plot the values I want. Consider the small snippet at the end of the email: colors and numbers inside the cells are OK, but the legend

Re: [R] Plotrix Trick

2010-06-24 Thread Hrishi Mittal
Lorenzo, I think your question was already answered by Jan van der Laan - http://r.789695.n4.nabble.com/Plotrix-Trick-tp2265893p2266722.html -- View this message in context: http://r.789695.n4.nabble.com/Plotrix-Trick-tp2267177p2267225.html Sent from the R help mailing list archive at

Re: [R] Correctly plotting bar and scatter chart on 2-y axis plot with par(new=T)

2010-06-24 Thread Greg Snow
Using par(new=T) is dangerous and tricky for those people who understand what it does and how to use it. Trying to use it without fully understanding it will be much worse. I would use the updateusr function from the TeachingDemos package instead. The first example on the help page may give

Re: [R] How to say if error

2010-06-24 Thread Duncan Murdoch
On 24/06/2010 11:12 AM, Paul Chatfield wrote: On a similar issue, how can you detect a warning in a loop - e.g. the following gives a warning, so I'd like to set up code to recognise that and then carry on in a loop x-rnorm(2);y-c(1,0) ff-glm(y/23~x, family=binomial) so this would be

[R] read.csv does not find my file (windows xp)

2010-06-24 Thread Ralf B
I try to load a file myData - read.csv(file=C:\\myfolder\\mysubfolder\\mydata.csv, head=TRUE, sep=;) and get this error: Error in file(file, rt) : cannot open the connection In addition: Warning message: In file(file, rt) : cannot open file 'C:\myfolder\mysubfolder\mydata.csv: No such file or

[R] how can I evaluate a formula passed as a string?

2010-06-24 Thread Mike Williamson
Hey everyone, I've been using 'R' long enough that I should have some idea of what the heck either expression() or eval() are really ever useful for. I come across another instance where I WISH they would be useful, but I cannot get them to work. Here is the crux of what I would

[R] help in SVM

2010-06-24 Thread Changbin Du
HI, GUYS, I used the following codes to run SVM and get prediction on new data set hh. dim(all_h) [1] 2034 24 dim(hh)# it contains all the variables besides the variables in all_h data set. [1] 640 415 require(e1071) svm.tune-tune(svm, as.factor(out) ~ ., data=all_h,

Re: [R] read.csv does not find my file (windows xp)

2010-06-24 Thread Uwe Ligges
On 24.06.2010 19:02, Ralf B wrote: I try to load a file myData- read.csv(file=C:\\myfolder\\mysubfolder\\mydata.csv, head=TRUE, sep=;) and get this error: Error in file(file, rt) : cannot open the connection In addition: Warning message: In file(file, rt) : cannot open file

Re: [R] how can I evaluate a formula passed as a string?

2010-06-24 Thread Peter Langfelder
On Thu, Jun 24, 2010 at 10:16 AM, Mike Williamson this.is@gmail.com wrote: Hey everyone,    I've been using 'R' long enough that I should have some idea of what the heck either   expression()  or eval()  are really ever useful for.  I come across another instance where I WISH they would

Re: [R] how can I evaluate a formula passed as a string?

2010-06-24 Thread Mike Williamson
Thank you, Peter! I sure love this help group!! :) Telescopes and bathyscaphes and sonar probes of Scottish lakes, Tacoma Narrows bridge collapse explained with abstract phase-space maps, Some x-ray slides, a music score, Minard's Napoleanic war: The most exciting frontier is charting

Re: [R] read.csv does not find my file (windows xp)

2010-06-24 Thread Ralf B
jep! I forgot to use sep= for paste and introducted a space in front of the filename... damn, 1 hour of my life! Ralf 2010/6/24 Uwe Ligges lig...@statistik.tu-dortmund.de: On 24.06.2010 19:02, Ralf B wrote: I try to load a file myData- read.csv(file=C:\\myfolder\\mysubfolder\\mydata.csv,

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-24 Thread David Winsemius
On Jun 23, 2010, at 9:58 PM, Atte Tenkanen wrote: Thanks. What I have had to ask is that how do you test that the data is symmetric enough? If it is not, is it ok to use some data transformation? when it is said: The Wilcoxon signed rank test does not assume that the data are sampled from

Re: [R] Sending a null byte to a socket

2010-06-24 Thread Dan Tenenbaum
Sorry to spam the list again, but I was wondering if anyone has a solution to this. It seems that writing nulls to sockets is a pretty common use case, so I would hope there is a way to do this. Thanks. On Wed, Jun 16, 2010 at 12:52 PM, Dan Tenenbaum dtenenb...@systemsbiology.org wrote: Hello,

Re: [R] help in SVM

2010-06-24 Thread Steve Lianoglou
Hi, On Thu, Jun 24, 2010 at 1:22 PM, Changbin Du changb...@gmail.com wrote: HI, GUYS, I used the following codes to run SVM and get prediction on new data set hh.  dim(all_h) [1] 2034   24  dim(hh)    # it contains all the variables besides the variables in all_h data set. [1] 640 415

[R] Displaying additional values on the Y-axis ggplot2

2010-06-24 Thread Christopher David Desjardins
Hi, I am running the following code: mfg0 - ggplot(aes(x=Grade,y=Math,colour=RiskStatic45678),data=math.f) mfg1 - mfg0 + geom_smooth(method=lm, formula=y ~ ns(x,2),size=1) + geom_smooth(aes(y=nalt.math,color=NALT),size=1,data=nalt) + scale_colour_brewer(Risk Status, pal=Set1) +

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-24 Thread Frank E Harrell Jr
On 06/24/2010 12:40 PM, David Winsemius wrote: On Jun 23, 2010, at 9:58 PM, Atte Tenkanen wrote: Thanks. What I have had to ask is that how do you test that the data is symmetric enough? If it is not, is it ok to use some data transformation? when it is said: The Wilcoxon signed rank test

Re: [R] probabilities from survfit.coxph

2010-06-24 Thread Therneau, Terry M., Ph.D.
In the example below (or for a censored data) using survfit.coxph, can anyone point me to a link or a pdf as to how the probabilities appearing in bold under summary(pred$surv) are calculated? These are predicted probabilities that a subject who is age 60 will still be alive. How this is

Re: [R] xyplot: adding pooled regression lines to a paneled type=r plot

2010-06-24 Thread Michael Friendly
Dennis Murphy wrote: Hi: Does this work for you? xyplot(distance ~ age | Sex, data = Orthodont, groups = Subject, main = 'Individual linear regressions ~ age', type = c('g', 'r'), panel = function(x, y, ...) { panel.xyplot(x, y, ..., col = gray(0.5))

Re: [R] Adjusted means and generalized chain block designs

2010-06-24 Thread Giles Crane
To whom it may concern: I compared several R package results, and manual checked two generalized chain block design experiments. The correct adjusted treatment means can be computed by using the effects library as follows: library(effects) aov1 = aov(y~blocks+rows+trt) means.aov =

Re: [R] How to say if error

2010-06-24 Thread Paul Chatfield
Thanks again Joris - you've been very helpful J From: Joris FA Meys [via R] [mailto:ml-node+2267176-1824205151-120...@n4.nabble.com] Sent: 24 June 2010 16:40 To: Paul Chatfield Subject: Re: How to say if error You could do that using the options, eg : set.seed(1) x - rnorm(1:10) y -

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-24 Thread Kjetil Halvorsen
¿Is'nt this just another name for multidimensional scaling? Kjetil On Thu, Jun 24, 2010 at 9:15 AM, Tal Galili tal.gal...@gmail.com wrote: Isn't this what ?dist Does ? Tal Contact Details:--- Contact me:

[R] help, bifurcation diagram efficiency

2010-06-24 Thread Tyler Massaro
Hello all - This code will run, but it bogs down my computer when I run it for finer and finer time increments and more generations. I was wondering if there is a better way to write my loops so that this wouldn't happen. Thanks! -Tyler # # Bifurcation diagram # Using

[R] Sweave with external R code

2010-06-24 Thread Gaston Fiore
Hello, I'm new to R and Sweave and I was wondering whether you can just include all your R code in external files and then call them from within the code chunks. I've read the Sweave User Manual but I couldn't find any specific information about this. Is this not customarily done? Thanks,

Re: [R] Question on WLS (gls vs lm)

2010-06-24 Thread Gabor Grothendieck
On Thu, Jun 24, 2010 at 9:20 AM, Viechtbauer Wolfgang (STAT) wolfgang.viechtba...@stat.unimaas.nl wrote: The weights in 'aa' are the inverse standard deviations. But you want to use the inverse variances as the weights: aa - (attributes(summary(f1)$modelStruct$varStruct)$weights)^2 And then

Re: [R] Sweave with external R code

2010-06-24 Thread Duncan Murdoch
On 24/06/2010 3:00 PM, Gaston Fiore wrote: Hello, I'm new to R and Sweave and I was wondering whether you can just include all your R code in external files and then call them from within the code chunks. I've read the Sweave User Manual but I couldn't find any specific information about

  1   2   >