Re: [R] Monte Carlo Simulation
What have you tried so far? It is often helpful to begin with a much simpler problem, then add complexity incrementally until you've constructed the desired model. Best wishes. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Shane Phillips Sent: Friday, April 15, 2011 2:50 PM To: r-help@r-project.org Subject: [R] Monte Carlo Simulation Hello, R friends... I am very new to R, and I need some help. I am trying to construct a simulation for my dissertation. I need to create 1000 datasets of 1000 subjects with the following variables... Treatment variable - Drawn from a binomial distribution (1 run, prob=.13) Covariate 1 - Drawn from a normal distribution (mean=100, sd=16) Covariate 2 - Drawn from a normal distribution (mean=200, sd=9) Covariates 1 and 2 need to be correlated (say, r=.80) Covariate 3 - Drawn from a binomial distribution (1 run, prob=.5) Covariate 4 - Drawn from a distribution of discrete variables where 1 has an 80% chance of being selected, 2 - 10%, 3 - 5% and 4 - 5%. This variable would need to be recoded into 4 binary variables. Covariate 5 - Drawn from a normal distribution (mean=84, sd=2) Covariate 6 - Drawn from a binomial distribution (1 run, prob=.15) Covariate 6 needs to correlate with Covariate 2 (r=.70, or so) I need each dataset saved as a new datafile with an iterative filename (e.g. sample1, sample2, etc.). Please help! Thanks! Shane __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] survfit - help avoiding re-inventing the wheel.
Greetings, R-ians: I would like to calculate the loglikelihood based on a Surv object and non-mle parameter estimates. I already have the mles as provided by survreg( Surv(time, time2, event, type) ). I can compute a loglikelihood based on a given density, censoring types, and parameter values, but find myself doing what must already be available, if I knew how to access it. The reason for wanting to compute a loglikelihood at non-mle values is to estimate the log likelihood ratios. Any help is much appreciated. Thanks. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] extracting x,y coordinates from a contour plot
Thank you, David: I obviously didn't look hard enough. This is exactly what I need. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: Monday, September 06, 2010 12:43 AM To: charles.an...@statisticalengineering.com Cc: r-help@r-project.org Subject: Re: [R] extracting x,y coordinates from a contour plot On Sep 5, 2010, at 11:48 PM, Charles Annis, P.E. wrote: Requisite info: R version 2.11.1 (2010-05-31) running on a 64 bit HP Windows 7 machine. Doubt that makes much of a difference here. I have used contour() for several years. Now I would like to extract from a contour plot the x, y coordinates of a contour z=constant. This seems as though it would be straight-forward but I've been unsuccessful in my searches of CRAN. Suggest you read the help page for contour and the pages to which it links as well as working the examples. The answer is illustrated in the examples on that page. Can anyone provide a hint? x - 10*1:nrow(volcano) y - 10*1:ncol(volcano) xy160 - contourLines(x, y, volcano, nlevels=1, levels=160) str(xy160) List of 2 $ :List of 3 ..$ level: num 160 ..$ x: num [1:165] 110 108 105 102 103 ... ..$ y: num [1:165] 295 300 310 320 330 ... $ :List of 3 ..$ level: num 160 ..$ x: num [1:31] 270 263 262 260 260 ... ..$ y: num [1:31] 310 320 330 340 350 ... -- David. David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] extracting x,y coordinates from a contour plot
Requisite info: R version 2.11.1 (2010-05-31) running on a 64 bit HP Windows 7 machine. Greetings, R-ians: I have used contour() for several years. Now I would like to extract from a contour plot the x, y coordinates of a contour z=constant. This seems as though it would be straight-forward but I've been unsuccessful in my searches of CRAN. Can anyone provide a hint? Thanks. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Servreg $loglik
Dear R-experts: I am using survreg() to estimate the parameters of a Weibull density having right-censored observations. Some observations are weighted. To do that I regress the weighed observations against a column of ones. When I enter the data as 37 weighted observations, the parameter estimates are exactly the same as when I enter the data as the corresponding 70 unweighted observations. This is to be expected, of course. I don't understand, however, why the reported loglikelihood is parameter.estimates$loglik [1] -120.4699 -120.4699 for the 37 weighted observations, but parameter.estimates$loglik [1] -135.1527 -135.1527 for the 70 unweighted observations. (For the record, my computations of the loglikelihood, using the dweibull() function for the observations and the pweibull() function for the censored observations, is -135.1527 for both 37 weighted and 70 unweighted.) I am using the data from Meeker and Escobar, _Statistical Methods for Reliability Data_, Wiley (1998), Table C.1, shown below: Hours Status Num.Parts 450 Failure 1 460 R-Censored 1 1150 Failure 2 1560 R-Censored 1 1600 Failure 1 1660 R-Censored 1 1850 R-Censored 5 2030 R-Censored 3 2070 Failure 2 2080 Failure 1 2200 R-Censored 1 3000 R-Censored 4 3100 Failure 1 3200 R-Censored 1 3450 Failure 1 3750 R-Censored 2 4150 R-Censored 4 4300 R-Censored 4 4600 Failure 1 4850 R-Censored 4 5000 R-Censored 3 6100 R-Censored 3 6100 Failure 1 6300 R-Censored 1 6450 R-Censored 2 6700 R-Censored 1 7450 R-Censored 1 7800 R-Censored 2 8100 R-Censored 2 8200 R-Censored 1 8500 R-Censored 3 8750 R-Censored 2 8750 Failure 1 9400 R-Censored 1 9900 R-Censored 1 10100 R-Censored 3 11500 R-Censored 1 I am running R version 2.11.1 (2010-05-31) on a HP Windows 7 box with 8 gig RAM. Thank you for your help. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Servreg $loglik
David: Thank you for your comments. I do understand that absolute values of likelihoods by themselves aren't meaningful, and only gain meaning when compared with others computed using the same model but with differing parameter values (for example). That is why I compute likelihoods myself for confidence interval construction using the loglikelihood ratio criterion. But when my plain-vanilla max(loglikelihood) didn't agree with that reported by survreg() (except when the data are unweighted) I was afraid I overlooked something. I am still puzzled that the servreg(), using the same model with the same data (37 weighted and the corresponding 70 unweighted) produces different values for loglik. Thank you for your help. It gives me peace of mind. ~:-) Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Tuesday, July 20, 2010 12:27 PM To: charles.an...@statisticalengineering.com Cc: r-help@r-project.org Subject: Re: [R] Servreg $loglik On Jul 20, 2010, at 11:20 AM, Charles Annis, P.E. wrote: Dear R-experts: I am using survreg() to estimate the parameters of a Weibull density having right-censored observations. Some observations are weighted. To do that I regress the weighed observations against a column of ones. When I enter the data as 37 weighted observations, the parameter estimates are exactly the same as when I enter the data as the corresponding 70 unweighted observations. This is to be expected, of course. I don't understand, however, why the reported loglikelihood is parameter.estimates$loglik [1] -120.4699 -120.4699 for the 37 weighted observations, but parameter.estimates$loglik [1] -135.1527 -135.1527 for the 70 unweighted observations. This has come up on r-help many times before (and probably on other lists as well), despite not being an R question at all. It is commonplace in modeling grouped data to see likelihoods reported differently from the result obtained when modeling ungrouped data representations with the same frequencies. The only valid statistical process is to compare differences in the likelihoods (or log(L) ), since the likelihood (or log(L) ) is only defined up to an arbitrary constant. You need to be comparing the result to some sort of null model for it to have any meaning. (... or perhaps that is your null model and you need to be looking at the impact of adding a covariate or two.) -- David. (For the record, my computations of the loglikelihood, using the dweibull() function for the observations and the pweibull() function for the censored observations, is -135.1527 for both 37 weighted and 70 unweighted.) I am using the data from Meeker and Escobar, _Statistical Methods for Reliability Data_, Wiley (1998), Table C.1, shown below: Hours Status Num.Parts 450 Failure 1 460 R-Censored 1 1150 Failure 2 1560 R-Censored 1 1600 Failure 1 1660 R-Censored 1 1850 R-Censored 5 2030 R-Censored 3 2070 Failure 2 2080 Failure 1 2200 R-Censored 1 3000 R-Censored 4 3100 Failure 1 3200 R-Censored 1 3450 Failure 1 3750 R-Censored 2 4150 R-Censored 4 4300 R-Censored 4 4600 Failure 1 4850 R-Censored 4 5000 R-Censored 3 6100 R-Censored 3 6100 Failure 1 6300 R-Censored 1 6450 R-Censored 2 6700 R-Censored 1 7450 R-Censored 1 7800 R-Censored 2 8100 R-Censored 2 8200 R-Censored 1 8500 R-Censored 3 8750 R-Censored 2 8750 Failure 1 9400 R-Censored 1 9900 R-Censored 1 10100 R-Censored 3 11500 R-Censored 1 I am running R version 2.11.1 (2010-05-31) on a HP Windows 7 box with 8 gig RAM. Thank you for your help. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] HELP - four.nines.cartesian.probability.grid
My routine (below) works OK but misbehaves if the on-screen plot is made wider using the mouse. The problem is caused by using par(usr)[1] - 0.07 * (par(usr)[2] - par(usr)[1]) to locate two items on the y-axis. The rest of the labeling is controlled by the line=0 parameter setting. Of course resizing changes the absolute plot width, and I'd rather have things with respect to the line= setting. (Try it: Cut and paste the code, then resize the screen plot to be wider.) Is there another way to do what I'm trying to do? I'm using R version 2.11.1 (2010-05-31), running on an HP 64 bit Windows 7 machine. Thanks four.nines.cartesian.probability.grid - function (X.data, x.title = X, y.title = Theoretical Normal CDF, X.start, X.end) { probs - c(0.0001, 0.0003, 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.98, 0.99, 0.995, 0.998, 0.999, 0.9997, 0.) z.vals - qnorm(probs) y.min - z.vals[1] y.max - z.vals[length(z.vals)] npts - length(X.data) X.mean - mean(X.data) X.sd - sd(X.data) X.001 - X.mean + X.sd * qnorm(0.001) X.999 - X.mean + X.sd * qnorm(0.999) plot(NA, axes = FALSE, xlim = c(X.start, X.end), ylim = c(qnorm(0.0001), qnorm(0.)), xlab = , ylab = ) axis(side = 1, labels = TRUE, at = pretty(c(X.001, X.data, X.999), n=8), line = 0, tick = TRUE, outer = FALSE) mtext(text = x.title, side = 1, line = 2.3, adj = 0.5) axis(side = 2, at = z.vals, labels = c(NA, NA, as.character(probs)[-(1:2)]), line = 0, tck = -0.01, las = 1, cex.axis = 0.8) x.loc - par(usr)[1] - 0.07 * (par(usr)[2] - par(usr)[1]) ## If plot is resized wider this may be troublesome. text(x = x.loc, y = z.vals[1], bquote(1* X *10^-4), cex = 0.75, xpd = TRUE) text(x = x.loc, y = z.vals[2], bquote(3* X *10^-4), cex = 0.75, xpd = TRUE) abline(h = qnorm(c(0.90, 0.95, 0.99, 0.999, 0.)), lty = 5, col = gray) abline(h = qnorm(c(0.10, 0.05, 0.01, 0.001, 0.0001)), lty = 5, col = gray) mtext(text = y.title, side = 2, line = 3, at = (y.max + y.min)/2, adj = 0.5) mtext(www.StatisticalEngineering.com, side = 1, line = 2.9, adj = 1, cex = 0.7) box() } windows(width = 6, height = 6, pointsize = 12) par(mar = c(4, 4, 0.5, 1) + 0.1) X.data - rnorm(n=100, mean = 8000, sd = 300) four.nines.cartesian.probability.grid(X.data, X.start = 7000, X.end = 9000) points(x = sort(X.data), y = qnorm1:length(X.data)) - 0.5)/length(X.data Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] P values
Please let me quote an eminently sensible person, who observed that ... p-values are dangerous, especially large, small, and in-between ones. - Frank E Harrell Jr., Prof. of Biostatistics and Department Chair, Vanderbilt University Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Robert A LaBudde Sent: Friday, May 07, 2010 12:29 PM To: Duncan Murdoch Cc: r-help@r-project.org; level Subject: Re: [R] P values At 07:10 AM 5/7/2010, Duncan Murdoch wrote: Robert A LaBudde wrote: At 01:40 PM 5/6/2010, Joris Meys wrote: On Thu, May 6, 2010 at 6:09 PM, Greg Snow greg.s...@imail.org wrote: Because if you use the sample standard deviation then it is a t test not a z test. I'm doubting that seriously... You calculate normalized Z-values by substracting the sample mean and dividing by the sample sd. So Thomas is correct. It becomes a Z-test since you compare these normalized Z-values with the Z distribution, instead of the (more appropriate) T-distribution. The T-distribution is essentially a Z-distribution that is corrected for the finite sample size. In Asymptopia, the Z and T distribution are identical. And it is only in Utopia that any P-value less than 0.01 actually corresponds to reality. I'm not sure what you mean by this. P-values are simply statistics calculated from the data; why wouldn't they be real if they are small? Do you truly believe an actual real-life distribution accurately is fit by a normal distribution at quantiles of 0.001, 0.0001 or beyond? The map is not the territory, and just because you can calculate something from a model doesn't mean it's true. The real world is composed of mixture distributions, not pure ones. The P-value may be real, but its reality is subordinate to the distributional assumption involved, which always fails at some level. I'm simply asserting that level is in the tails at probabilities of 0.01 or less. Statisticians, even eminent ones such as yourself and lesser lights such as myself, frequently fail to keep this in mind. We accept such assumptions as normality, equal variances, etc., on an eyeballometric basis, without any quantitative understanding of what this means about limitations on inference, including P-values. Inference in statistics is much cruder and more judgmental than we like to portray. We should at least be honest among ourselves about the degree to which our hand-waving assumptions work. I remember at the O. J. Simpson trial, the DNA expert asserted that a match would occur only once in 7 billion people. I wondered at the time how you could evaluate such an assertion, given there were less than 7 billion people on earth at the time. When I was at a conference on optical disk memories when they were being developed, I heard a talk about validating disk specifications against production. One statement was that the company would also validate the undetectable error rate specification of 1 in 10^16 bits. I amusingly asked how they planned to validate the undetectable error rate. The response was handwaving and Just as we do everything else. The audience laughed, and the speaker didn't seem to know what the joke was. In both these cases the values were calculable, but that didn't mean that they applied to reality. Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: r...@lcfltd.com Least Cost Formulations, Ltd.URL: http://lcfltd.com/ 824 Timberlake Drive Tel: 757-467-0954 Virginia Beach, VA 23464-3239Fax: 757-467-2947 Vere scire est per causas scire __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Logit/probit model
Perhaps I am missing something but it appears that because X1 and X2 are random normal, that the influence of X2 is much like a second sampling of X1, and thus you would expect just what you observed, especially with a large (1000) sample size. Try making X2 and X1 different. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ana De Barros Sent: Thursday, March 25, 2010 12:19 PM To: r-help@r-project.org Subject: [R] Logit/probit model Deal all, I have a population with the following characteristics: N=1000 X0=rep(1,N) X1=rnorm(N) X2=rnorm(N) I also know that the population distribution is a linear logistic function with parameters alpha0=0 (intercept), alpha1=0.4 and alpha2=1.1. So easily I can get the dependent variable (in my case the response propensities) by doing: alpha=as.vector(c(0, 0.4, 1.1)) X=cbind(X0,X1, X2) X=matrix(X, ncol=3, nrow=N) P=X%*%alpha propensity=1/(1+exp(-(P))) proptrue=mean(propensity) I have to estimate by sampling simulation the response propensity (dependent variable), assuming I don9t know the population distribution and assuming: 1. a linear logistic function adjusting for x1 only 1.1 assuming I know the true parameters (alpha0=0 and alpha1=0.4) 1.2 assuming I don9t know the true parameters 2. a probit function adjusting for x1 only 2.1 assuming I know the true parameters (alpha0=0 and alpha1=0.4) 2.2 assuming I don9t know the true parameters When I assume I don9t know the true parameters I sample by doing for (g in 1:replicas) { labels=sample(N, sample.size, replace=FALSE) x0=X0[labels] x1=X1[labels] x2=X2[labels] propsample=propensity[labels] logitx1=glm(propsample~x1, family=binomial(link=logit)) coefx1= logitx1$coefficients fitx1= logitx1$fitted.values PSprob=mean(fitx1) probx1=glm(propsample~x1, family=binomial(link=probit)) c33= probx1$coefficients cc33= probx1$fitted.values PSprob=mean(cc33) } My problem is that although I omit x2 in the simulations I still get very similar results (similar response propensities) with the population response propensity and it doesn9t make any sense... I must be doing something wrong but I don9t find the error. Can you help me, please? Thanks a lot Ana [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Decreasing Cumsum Function?
how about sum(X) - cumsum(X) Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gundala Viswanath Sent: Monday, March 22, 2010 9:02 PM To: r-h...@stat.math.ethz.ch Subject: [R] Decreasing Cumsum Function? Hi all, I have a frequency data that looks like this. 3 2 1 5 What I want to get is the decreasing cumulative of this data yielding 11 8 6 5 0 Is there any? I am aware of cumsum(), which will yield 3 5 6 11. But it is not what I want. - G.V. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R Aerodynamic Package(s)?
Jason: What are you trying to do? Your reference link provides several Fortran programs. Why can't you use those? Or you could translate them into R code if you would like to take advantage of R's wonderful graphics and multitudinous other statistical adjuncts. Your request seems too broad to allow a more focused response. Perhaps we could be more helpful if you told us what you are trying to accomplish. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jason Rupert Sent: Saturday, February 27, 2010 8:39 AM To: R-help@r-project.org Subject: Re: [R] R Aerodynamic Package(s)? I received zero responses to this post, so I guess this confirms that R is not the correct target language for this project. Maybe Octave is better suited... Thank you again. - Original Message From: Jason Rupert jasonkrup...@yahoo.com To: R-help@r-project.org Cc: Me jasonkrup...@yahoo.com Sent: Tue, February 23, 2010 6:33:18 AM Subject: R Aerodynamic Package(s)? By any chance is anyone aware of any R Packages that contain or expand the aerodynamic capabilities mentioned on the following website? http://www.aoe.vt.edu/~mason/Mason_f/MRsoft.html Typically I know R packages have focused on extending the statistical and graphing capability within R, so I was just curious if there might be a package that contains some aerodynamics. If by chance there isn't a package, is there any interest, in the development of a package or the use of a such an R package? Just curious what the user/developer community thought about this? I know MatLab and proprietary software executables is the typical place where aerodynamic analysis is performed, so any feedback about such a package existing/being created in R is great. Thanks again. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Integral of function of dnorm
Here's a suggestion: Plot the function: x - seq(3, 13, length=101) plot(x, y=dnorm(x, mean=8,sd=1)*log(dnorm(x,mean=8,sd=1))) x - seq(7.5, 8.5, length=101) plot(x, y=dnorm(x, mean=8,sd=1)*log(dnorm(x,mean=8,sd=1))) x - seq(7.9, 8.1, length=101) plot(x, y=dnorm(x, mean=8,sd=1)*log(dnorm(x,mean=8,sd=1))) This suggests to me that you can integrate over restricted domains of x, and sum the intermediate results. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Trafim Vanishek Sent: Thursday, February 11, 2010 11:49 AM To: Peter Dalgaard Cc: r-help@r-project.org Subject: Re: [R] Integral of function of dnorm This is exactly what I mean. I need to find integrate(dnorm(mean=8,sd=1)*log(dnorm(mean=8,sd=1)), -Inf, Inf) Which doesn't work like that, because it says: Error in dnorm(mean = 8, sd = 1) : element 1 is empty; the part of the args list of '.Internal' being evaluated was: (x, mean, sd, log) So how can I define x? THanks a lot Dear all, How is it possible in R to calculate the following integral: Integral(-Inf, Inf)[log(dnorm(mean = 3, sd = 1))] how can I define that the density dnorm is taken on (-Inf, Inf) Thanks a lot! Er, if you mean integral with respect to the x argument in dnorm, then the answer is -Inf because log(dnorm(x,...)) goes quadratically to -Inf in both directions. If you meant otherwise, please tell us what you meant... [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problems by saving Rprofile.site under vista
You may have to run R as Administrator (right-click, choose run as administrator) to make these kinds of changes. After you have things the way you like them, run R in the usual way by clicking on the icon. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of anna_l Sent: Friday, November 13, 2009 11:46 AM To: r-help@r-project.org Subject: [R] Problems by saving Rprofile.site under vista Hello, I am trying to save some changes I have done on the Rprofile.site under vista and it doesn´t let me save the file saying that it can´t create the following file (Rprofile.site) and that I should check the pathfile or the file name. -- View this message in context: http://old.nabble.com/Problems-by-saving-Rprofile.site-under-vista-tp26339605p26339605.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Cannot activate chm help in R 2.10
R-insiders: While trying to be clever I inserted these lines in ..\Rprofile.site (which works in R2.9.2 and earlier) # to prefer Compiled HTML help options(chmhelp=TRUE) but upon re-starting R2.10.0 I learned that chmhelp = TRUE is no longer supported: use help_type =text I'm sure this was explained elsewhere but I missed it. Could someone explain why the compiled html help is no longer supported? Thanks. Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ulrike Groemping Sent: Tuesday, October 27, 2009 4:17 PM To: r-help@r-project.org Subject: Re: [R] Cannot activate chm help in R 2.10 Uwe Ligges-3 wrote: Duncan Murdoch wrote: On 10/27/2009 10:56 AM, Ulrike Groemping wrote: Duncan Murdoch-2 wrote: Ulrike Groemping wrote: ... My system is Windows XP, German locale computer. On installation, I was asked to decide for text or html help and chose html (there was no radio button for chm help). ... If you set options(help_type=html) you'll get HTML help with links in your default browser. Duncan Murdoch Thank you very much, this works. But I am very surprised that it is not the default. Having chosen html help during installation, I would have expected this to be active without having to change an option. Yes, it should have been, but there was a bug in the installer, and the preference indicated there was ignored. This is why it's useful to have people doing testing during the beta test period: things like this are easy to fix, but they need to be noticed first. Duncan Murdoch And let me add: The whole statistics department has been on two pre-release versions (beta and release-candidate) and nobody reported any error. The installer problem has not been found because I installed from sources anyway. This shows it makes sense to have more than just 400+ beta testers. ;-) Uwe Two more comments: For those of us who have already installed the version with this installer bug: If you do not want to change the option each time you call R, it is easy to change it permanently in the file R_HOME/etc/Rprofile.site (where R_HOME stands for the directory in which your R is installed, e.g. c:\programs\r\r-2.10.0). Regarding beta testing (yes, I admit, I usually leave that to others, and am nevertheless looking for beta testers of my package RcmdrPlugin.DoE), maybe it would be time for an experimental design that specifies characteristics of beta testers to ensure some diversity there, perhaps package DoE.base or FrF2 could help there (half-, but only half-jokingly) ;-) Regards, Ulrike -- View this message in context: http://www.nabble.com/Cannot-activate-chm-help-in-R-2.10-tp26067423p26084237 .html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] News on R s largest corporate partner REVolution Computingand SPSS CEO:
David: Do you mean inappropriate or embarrassing? How would we R-ians know what has happened at REVolution were it not for Ajay's note? Were you planning a press release? Something like, 47% of Revolution summarily fired. Nobody left with more than a year of experience...? Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David M Smith Sent: Wednesday, October 21, 2009 2:20 PM To: Ajay ohri Cc: r-help@r-project.org Subject: Re: [R] News on R s largest corporate partner REVolution Computingand SPSS CEO: It is clearly inappropriate for me or anyone else from REvolution to comment on matters pertaining to any employee or ex-employee. I would further add that this is a highly inappropriate use of this list. Apologies to all concerned. # David Smith On Wed, Oct 21, 2009 at 1:51 PM, Ajay ohri ohri2...@gmail.com wrote: Start the REvolution without me... -- David M Smith da...@revolution-computing.com VP of Community, REvolution Computing www.revolution-computing.com Tel: +1 (206) 577-4778 x3203 (Palo Alto, CA, USA) Download REvolution R free: http://revolution-computing.com/downloads/revolution-r.php __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Fortran vs R
WARNING! Biased opinion. I'm an old guy who learned programming nearly 50 years ago when FORTRAN (IV) was it, unless you wanted to write machine language which, being an engineer, I was less interested in than in getting an answer so I could get on with things. I like FORTRAN, but I can't think of anything that R couldn't do better and easier. R is interpreted and thus is slower than compiled FORTRAN but unless you have a very (very, very) specific application where you need compiled speed, R wins by a mile. Don't learn FORTRAN. Invest your time in Python if you must learn another language. R would be my choice if I were you. Mister Know-It-All Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Paul Simonin Sent: Wednesday, September 23, 2009 11:13 AM To: R Help Listserve Subject: [R] Fortran vs R Hello R users, I have a basic computer programing question. I am a student currently taking a course that uses Fortran as the main programming language, but the instructors are open to students using any language they are familiar with. I have used R previously, and am wondering if there is any benefit to my learning Fortran, or whether I should stick with R for this class. Any advice? Are there clear benefits to using Fortran, or things Fortran can do that R cannot? Thank you very much for any thoughts! Sincerely, Paul S. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Scripting - sort of
Dear R-ians: I'm running R2.9.2 on a 6 year old Windows XP DELL with 2 Gig RAM and a 3MHz Pentium 4 chip. I've written a package using the User Menus Under Windows commands (winMenuAdd, etc). It works very well. I have 6 test cases and running any one of them requires many selections form the menus and some keyboard entry, and it takes me hours to exercise them all to see that my changes to the R code produced no unexpected results. Is there a way to record my mouse movements and mouse clicks, as well as keyboard entry, in a script, so that I can just watch to see if all unfolds correctly? Many thanks for any suggestions. Charles Annis, P.E. mailto:charles.an...@statisticalengineering.com charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Scripting - sort of
Thanks to Gabor Grothendieck and to David Huffer for suggesting autoit and autohotkey, neither of which I had heard of. I'll take a look. Thanks! Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gabor Grothendieck Sent: Wednesday, August 26, 2009 12:32 PM To: charles.an...@statisticalengineering.com Cc: r-help@r-project.org Subject: Re: [R] Scripting - sort of autoit and autohotkey are two free Windows utilities based on the basic language that can be used for GUI scripting. On Wed, Aug 26, 2009 at 12:22 PM, Charles Annis, P.E.charles.an...@statisticalengineering.com wrote: Dear R-ians: I'm running R2.9.2 on a 6 year old Windows XP DELL with 2 Gig RAM and a 3MHz Pentium 4 chip. I've written a package using the User Menus Under Windows commands (winMenuAdd, etc). It works very well. I have 6 test cases and running any one of them requires many selections form the menus and some keyboard entry, and it takes me hours to exercise them all to see that my changes to the R code produced no unexpected results. Is there a way to record my mouse movements and mouse clicks, as well as keyboard entry, in a script, so that I can just watch to see if all unfolds correctly? Many thanks for any suggestions. Charles Annis, P.E. mailto:charles.an...@statisticalengineering.com charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] distinguish regression lines in grouped, black and white lattice xyplot
Perhaps what you do should depend on what you want to see. If all the lines lie near one another that says one thing. If all but one or two agree but the mavericks are in obvious disagreement, then that begs to ask why? If the entire lot looks like spaghetti, then that is informative also. So plotting all on one grid isn't of itself bad. That depends on what you are trying to do. Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Katharina May Sent: Wednesday, June 24, 2009 5:05 PM To: r-help@r-project.org Subject: Re: [R] distinguish regression lines in grouped,black and white lattice xyplot That's a point. I justed wanted to provide an overview for myself to see the tendencies in a direct comparement and with an easy way to distinct them, but maybe the text panel can help me with that... Well anyway, is it right that a grouped black and white plot can contain a maxinum of 8 distinguishable lines or might there be a way to increase that? I know some graphics from papers containing lines with equally distance points on the lines (one type of point per line) as a form of distinction. Can this be realised using grouped lattice plots with regression lines? 2009/6/24 Bert Gunter gunter.ber...@gene.com: Don't be silly. They can't be made distinguishable by any number of line types and/or colors. The brain can't keep that many different symbol representations straight. Referring back and forth to a legend is also similarly useless. You need to think more creatively about how to make a more meaningful display to provide viewers interpretable information. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Katharina May Sent: Wednesday, June 24, 2009 12:28 PM To: r-help@r-project.org Subject: [R] distinguish regression lines in grouped,black and white lattice xyplot Hi, I've got the following problem which I cannot think of a solution right now: if got a lattice xyplot in black and white and a grouping variable with many (more than 8 values) and I plot it as regression lines (type=r), just like this one (not reproducable but that's I guess not the point here): xyplot(log(AGWB) ~ log(BM_roots), data=sub_agwb_data, groups=species, type=r, lty=c(1:6),panel=allo.panel.5) The problem is that I've got 26 different values for the grouping variable species and only 6 default values for the line type lty (and according to the par {graphics} help page customizable to up to 8 different line types). Does anybody have any idea how these 26 different lines can be made distinguishable from each other without the use of colors? Thanks, Katharina __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Time flies like an arrow, fruit flies like bananas. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Running R from a read-only CD
Dear R-helpers: I created a folder containing R on a read-only CD and use it by having the R-icon, located on the Windows desktop, point to the CD (R-2.8.1\bin\Rgui.exe) for the Target, and to a Windows Desktop folder for Start in. This works nicely EXCEPT that the R help() function cannot display anything, and presents a screen message saying This program cannot display webpage. This is especially frustrating because on the left of what would be the help window is the exhaustive list of all the functions for which R can provide help (but can't display anything). Can anyone provide guidance? Here is the obligatory session information: sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] splines tcltk stats graphics grDevices utils datasets methods base other attached packages: [1] mh1823_2.5.4.1 survival_2.35-3RColorBrewer_1.0-2 RODBC_1.2-5 Thanks! Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Running R from a read-only CD
After reading your suggested page, it does appear that the problem is a security feature that I will have to live with since the CDs will be running on borrowed computers. BUT, if the same R-folder is loaded from a USB Flash Drive, rather than a CD, the help files work just fine. So perhaps there is another way. Any other ideas? Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] Sent: Monday, May 25, 2009 4:57 PM To: charles.an...@statisticalengineering.com Cc: r-help@r-project.org Subject: Re: [R] Running R from a read-only CD On 25/05/2009 4:40 PM, Charles Annis, P.E. wrote: Dear R-helpers: I created a folder containing R on a read-only CD and use it by having the R-icon, located on the Windows desktop, point to the CD (R-2.8.1\bin\Rgui.exe) for the Target, and to a Windows Desktop folder for Start in. This works nicely EXCEPT that the R help() function cannot display anything, and presents a screen message saying This program cannot display webpage. This is especially frustrating because on the left of what would be the help window is the exhaustive list of all the functions for which R can provide help (but can't display anything). Can anyone provide guidance? Here is the obligatory session information: sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] splines tcltk stats graphics grDevices utils datasets methods base other attached packages: [1] mh1823_2.5.4.1 survival_2.35-3RColorBrewer_1.0-2 RODBC_1.2-5 Thanks! This sounds like a Windows security feature, because .CHM is a risky format. There's a page here http://support.microsoft.com/kb/896054 that tells you how to turn it off. Alternatively, you can choose one of the other help formats in R besides CHM help. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Running R from a read-only CD
I'm not sure how not to use chm help, since that's the only way I've ever done things. But why would things work well from a USB Flash Drive and not for a CD when the folders are identical? (The CD was burned from the image on the Flash Drive.) Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] Sent: Monday, May 25, 2009 5:23 PM To: charles.an...@statisticalengineering.com Cc: r-help@r-project.org Subject: Re: [R] Running R from a read-only CD On 25/05/2009 5:18 PM, Charles Annis, P.E. wrote: After reading your suggested page, it does appear that the problem is a security feature that I will have to live with since the CDs will be running on borrowed computers. BUT, if the same R-folder is loaded from a USB Flash Drive, rather than a CD, the help files work just fine. So perhaps there is another way. Any other ideas? Don't use CHM help. Duncan Murdoch Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] Sent: Monday, May 25, 2009 4:57 PM To: charles.an...@statisticalengineering.com Cc: r-help@r-project.org Subject: Re: [R] Running R from a read-only CD On 25/05/2009 4:40 PM, Charles Annis, P.E. wrote: Dear R-helpers: I created a folder containing R on a read-only CD and use it by having the R-icon, located on the Windows desktop, point to the CD (R-2.8.1\bin\Rgui.exe) for the Target, and to a Windows Desktop folder for Start in. This works nicely EXCEPT that the R help() function cannot display anything, and presents a screen message saying This program cannot display webpage. This is especially frustrating because on the left of what would be the help window is the exhaustive list of all the functions for which R can provide help (but can't display anything). Can anyone provide guidance? Here is the obligatory session information: sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] splines tcltk stats graphics grDevices utils datasets methods base other attached packages: [1] mh1823_2.5.4.1 survival_2.35-3RColorBrewer_1.0-2 RODBC_1.2-5 Thanks! This sounds like a Windows security feature, because .CHM is a risky format. There's a page here http://support.microsoft.com/kb/896054 that tells you how to turn it off. Alternatively, you can choose one of the other help formats in R besides CHM help. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] clear screen?
Ive been using this routine for several years. Im sorry, I dont remember where I got it. It works as it should, viz. it blanks the R console. But it requires package rcom and now that requires rscproxy. cls - function () { require(rcom) wsh - comCreateObject(Wscript.Shell) comInvoke(wsh, SendKeys, \f) invisible(wsh) } cls() Loading required package: rcom Loading required package: rscproxy This seems like overkill to me just to blank the R console, especially since I am trying to diminish the number of necessary packages to support my home-brew package. So, is there an easier way to blank the R console in Windows? sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] splines tcltk stats graphics grDevices utils datasets methods base other attached packages: [1] rcom_2.1-1 rscproxy_1.2-0 survival_2.35-3 RColorBrewer_1.0-2 RODBC_1.2-5 myhomebrew loaded via a namespace (and not attached): [1] tools_2.8.1 Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] clear screen?
Thank you Gabor. I'm sorry I forgot whom to acknowledge as the author. My (limited) understanding is that rcom with rscproxy essentially give the R session the ability to look like a server, and that this scares some who are concerned with security issues. I don't want any more capability than necessary and thus wanted something less potent to clear the console. Thanks for the insight. Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Sunday, May 03, 2009 7:31 PM To: charles.an...@statisticalengineering.com Cc: r-help@r-project.org Subject: Re: [R] clear screen? You got it from my post here: http://tolstoy.newcastle.edu.au/R/help/06/02/21556.html Don't know why rcom's dependencies are a consideration but RDCOMClient can also handle this: cls - function () { require(RDCOMClient) wsh - COMCreate(Wscript.Shell) wsh$SendKeys(\f) invisible(wsh) } cls() On Sun, May 3, 2009 at 6:50 PM, Charles Annis, P.E. charles.an...@statisticalengineering.com wrote: Ive been using this routine for several years. Im sorry, I dont remember where I got it. It works as it should, viz. it blanks the R console. But it requires package rcom and now that requires rscproxy. cls - function () { require(rcom) wsh - comCreateObject(Wscript.Shell) comInvoke(wsh, SendKeys, \f) invisible(wsh) } cls() Loading required package: rcom Loading required package: rscproxy This seems like overkill to me just to blank the R console, especially since I am trying to diminish the number of necessary packages to support my home-brew package. So, is there an easier way to blank the R console in Windows? sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] splines tcltk stats graphics grDevices utils datasets methods base other attached packages: [1] rcom_2.1-1 rscproxy_1.2-0 survival_2.35-3 RColorBrewer_1.0-2 RODBC_1.2-5 myhomebrew loaded via a namespace (and not attached): [1] tools_2.8.1 Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] compiled help pages
Greetings: This should be easy but it isn't. I have a home-brew package that works fine, with compiled html help pages, all 150 of them. I want to make a similar package but not from scratch since only a half-dozen routines are changed. So I created a new directory, copied the old package into it and changed the name to newSTUFF. I changed the names of all help pages too, as weill as their aliases, and of course I changed the DESCRIPTION. Then I executed R CMD build --binary newSTUFF. The package was built, including the compiled help pages, and automatically zipped. I install the package, and then load it and it runs perfectly - EXCEPT for the help(newSTUFF) command, which gives this error message: No documentation for ' newSTUFF ' in specified packages and libraries: you could try '?? newSTUFF ' But when I look at the contents of the ZIP file that R has made, it says the newSTUFF compiled help pages are there: newSTUFF/ newSTUFF/chtml/ newSTUFF/chtml/newSTUFF.chm What's even more puzzling is that the command: help(package=newSTUFF) DOES work, as it should. Only help(newSTUFF) doesn't. How did I mess this up? Thanks. Charles Annis, P.E. mailto:charles.an...@statisticalengineering.com charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] compiled help pages - OS info
Oops! I forgot the obligatory OS and session info: sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] splines stats graphics grDevices utils datasets methods base other attached packages: [1] mh1823AECL_2.5.4 survival_2.35-3RColorBrewer_1.0-2 RODBC_1.2-5 rcom_2.1-1 [6] rscproxy_1.2-0 Charles Annis, P.E. mailto:charles.an...@statisticalengineering.com charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] compiled help pages
Thank you, Duncan! You are right-as-rain: I forgot to change the aliases. A single change from \alias{STUFF} to \alias{newSTUFF} in the newSTUFF-package.Rd file did the trick. Thanks! Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan Murdoch Sent: Saturday, May 02, 2009 7:44 PM To: charles.an...@statisticalengineering.com Cc: r-help@r-project.org Subject: Re: [R] compiled help pages On 02/05/2009 6:37 PM, Charles Annis, P.E. wrote: Greetings: This should be easy but it isn't. I have a home-brew package that works fine, with compiled html help pages, all 150 of them. I want to make a similar package but not from scratch since only a half-dozen routines are changed. So I created a new directory, copied the old package into it and changed the name to newSTUFF. I changed the names of all help pages too, as weill as their aliases, and of course I changed the DESCRIPTION. Then I executed R CMD build --binary newSTUFF. The package was built, including the compiled help pages, and automatically zipped. I install the package, and then load it and it runs perfectly - EXCEPT for the help(newSTUFF) command, which gives this error message: No documentation for ' newSTUFF ' in specified packages and libraries: you could try '?? newSTUFF ' But when I look at the contents of the ZIP file that R has made, it says the newSTUFF compiled help pages are there: newSTUFF/ newSTUFF/chtml/ newSTUFF/chtml/newSTUFF.chm ? and ?? don't look at filenames, they look at the aliases within the file. I'm guessing from your description that you changed the filename but didn't edit the alias to match. What's even more puzzling is that the command: help(package=newSTUFF) DOES work, as it should. Only help(newSTUFF) doesn't. help(package=newSTUFF) treats newSTUFF as a package name. Duncan Murdoch How did I mess this up? Thanks. Charles Annis, P.E. mailto:charles.an...@statisticalengineering.com charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Cannot clean infinite values
?is.infinite Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Nigel Birney Sent: Sunday, April 26, 2009 8:45 PM To: r-help@r-project.org Subject: [R] Cannot clean infinite values Hello all, I have to import numeric data from file but found it contains Infinite values which need to be eliminated. I tried to replace them in this way: data[which(data==-Inf)] - -0.3 data[which(data==+Inf)] - 0.3 But, somehow, the Infinite values stayed there. Any suggestions? regards, N. -- View this message in context: http://www.nabble.com/Cannot-clean-infinite-values-tp23248409p23248409.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Flipping axes of qqnorm
?qqnorm qqnorm(y, ylim, main = Normal Q-Q Plot, xlab = Theoretical Quantiles, ylab = Sample Quantiles, plot.it = TRUE, datax = TRUE, ...) Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Chris_d Sent: Sunday, April 26, 2009 7:38 PM To: r-help@r-project.org Subject: [R] Flipping axes of qqnorm Hi all, I have just started using R to produce qqnorm plots. I am trying to switch the x and y axes so that the theoretical values are plotted on the y axis and my data on the x axis. Can anyone help me with this? Thanks -- View this message in context: http://www.nabble.com/Flipping-axes-of-qqnorm-tp23248007p23248007.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Discover significant change in sorted vector
Please excuse my nit-picking: In physicists the third and fourth derivative of position are jerk (or jolt) and jounce, respectively. Impulse is the integral of force with respect to time. Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: Wednesday, April 22, 2009 8:47 AM To: Hans-Henning Gabriel Cc: r-help@r-project.org Subject: Re: [R] Discover significant change in sorted vector On Apr 22, 2009, at 8:06 AM, Hans-Henning Gabriel wrote: Hans-Henning Gabriel wrote: Hi, suppose I have a simple sorted vector like this: a - c(2,3,3,5,6,8,8,9,15, 25, 34,36,36,38,41,43,44,44,46); Is there a function in R, I can use to discover that from index 8 to index 11 the values are changing significantly? The function should return a value pointing to one of the indices 8, 9, 10 or 11. Any of them would be fine. The difficulty is that there may be no big gap. I mean, indices 8 and 11 are somehow connected by indices 9 and 10. So, it's not an option to just search for biggest difference between the values. Perfect would be a function that is able to discover multiple changes if it is present in the data. Hi Henning, Is max(diff(a)) any good to you? Jim Hi Jim, no, I'm affraid it's not. It's more like that the slope is low for many values, then it starts getting stronger for few values, then it gets low again for many values. But the thing is that the slope may _not_ change immediately. Well something needs to change immediately. Think of this as position, speed and acceleration, i.e. speed is the first derivative of position and acceleration is the second derivative. (In physics the third derivative is sometimes called impulse, the thing that changes when acceleration goes from zero to some positive value.) If first differences is not what you want, then look at second differences as below: x - c(2,3,3,5,6,8,8,9,15, 25, 34,36,36,38,41,43,44,44,46); max(diff(diff(x))) [1] 5 diff(diff(x)) [1] -1 2 -1 1 -2 1 5 4 -1 -7 -2 2 1 -1 -1 -1 2 which(diff(diff(x))==max(diff(diff(x [1] 7 David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] threshold distribution
The data suggest a lognormal threshold to me (and perhaps to the originator, based on his title). ## x - c(0.80010, 0.72299, 0.69893, 0.99597, 0.89200, 0.69312, 0.73613, 1.13559, 0.85009, 0.85804, 0.73324, 1.04826, 0.84002, 1.76330, 0.71980, 0.89416, 0.89450, 0.98670, 0.83571, 0.73833, 0.66549, 0.93641, 0.80418, 0.95285, 0.76876, 0.82588, 1.09394, 1.00195, 1.14976, 0.80008, 1.11947, 1.09484, 0.81494, 0.68696, 0.82364, 0.84390, 0.71402, 0.80293, 1.02873) # plot the original density x.threshold - 0 qqnorm(log(x - x.threshold), datax = TRUE) qqline(log(x - x.threshold), datax = TRUE) # plot the lognormal density with a threshold x.threshold - 0.63 qqnorm(log(x - x.threshold), datax = TRUE) qqline(log(x - x.threshold), datax = TRUE) # compute and plot the associated log likelihoods x.threshold - 0 loglikelihood - 1/(x-x.threshold) * dnorm(log(x - x.threshold), mean(log(x - x.threshold)), sd(log(x - x.threshold))) x.threshold - 0.63 loglikelihood.63 - 1/(x-x.threshold) * dnorm(log(x - x.threshold), mean(log(x - x.threshold)), sd(log(x - x.threshold))) x.minus.x.threshold - x - x.threshold plot(x.minus.x.threshold, loglikelihood.63, xlim = c(0, 2), ylim =c(0, 3.5)) points(x, loglikelihood, col=red) # compare loglikelihood ratio with chi-square sum.loglikelihood - sum(loglikelihood) print(sum.loglikelihood) sum.loglikelihood.63 - sum(loglikelihood.63) print(sum.loglikelihood.63) log.likelihiood.ratio - sum.loglikelihood.63 - sum.loglikelihood print(log.likelihiood.ratio) significant.difference - qchisq(p = 0.95, df = 1)/2 print(significant.difference) # Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mike Lawrence Sent: Sunday, April 05, 2009 8:13 AM To: t...@centroin.com.br Cc: r-help Subject: Re: [R] threshold distribution You didn't properly specify the x-axis coordinates in your call to lines(): plot(density(x)) lines(x,dlnorm(x, -.1348, .1911), col='red') points(x,dlnorm(x, -.1348, .1911), col='blue') curve(dlnorm(x, -.1348, .1911), col='green',add=T) On Sun, Apr 5, 2009 at 6:40 AM, Bernardo Rangel Tura t...@centroin.com.br wrote: On Sun, 2009-04-05 at 01:13 -0400, jim holtman wrote: Here is what I get from using 'fitdistr' in R to fit to a lognormal. The resulting density plot from the distribution seems to be a reason match to the data. x - scan() 1: 0.80010 0.72299 0.69893 0.99597 0.89200 0.69312 0.73613 1.13559 9: 0.85009 0.85804 0.73324 1.04826 0.84002 14: 1.76330 0.71980 0.89416 0.89450 0.98670 0.83571 0.73833 0.66549 22: 0.93641 0.80418 0.95285 0.76876 0.82588 27: 1.09394 1.00195 1.14976 0.80008 1.11947 1.09484 0.81494 0.68696 35: 0.82364 0.84390 0.71402 0.80293 1.02873 40: Read 39 items plot(density(x)) library(MASS) fitdistr(x, 'lognormal') meanlog sdlog -0.13480636 0.19118861 ( 0.03061468) ( 0.02164785) lines(dlnorm(x, -.1348, .1911), col='red') Hi Jim I agree with your solution but my plot result not fine. I obtain same result. fitdistr(x, 'lognormal') meanlog sdlog -0.13480636 0.19118861 ( 0.03061468) ( 0.02164785) In plot when I use points (blue) and curve (green) the fit o lognormal and density(data) is fine but when I use lines (red) the fit is bad (in attach I send a PDF of my output) Do you know why this happen? Thanks in advance -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil P.S. my script is x - scan() 0.80010 0.72299 0.69893 0.99597 0.89200 0.69312 0.73613 1.13559 0.85009 0.85804 0.73324 1.04826 0.84002 1.76330 0.71980 0.89416 0.89450 0.98670 0.83571 0.73833 0.66549 0.93641 0.80418 0.95285 0.76876 0.82588 1.09394 1.00195 1.14976 0.80008 1.11947 1.09484 0.81494 0.68696 0.82364 0.84390 0.71402 0.80293 1.02873 require(MASS) fitdistr(x, 'lognormal') pdf(adj.pdf) plot(density(x)) lines(dlnorm(x, -.1348, .1911), col='red') points(x,dlnorm(x, -.1348, .1911), col='blue') curve(dlnorm(x, -.1348, .1911), col='green',add=T) dev.off() __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Mike Lawrence Graduate Student Department of Psychology Dalhousie University Looking to arrange a meeting? Check my public calendar: http://tinyurl.com/mikes-public-calendar ~ Certainty is folly... I think. ~ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code
Re: [R] threshold distribution
In my haste I forgot to take the logs of the likelihoods. How embarrassing. The conclusion is unchanged - the data support a non-zero threshold. Here's the corrected code: x.threshold - 0 loglikelihood - log(1/(x-x.threshold) * dnorm(log(x - x.threshold), mean(log(x - x.threshold)), sd(log(x - x.threshold sum.loglikelihood - sum(loglikelihood) print(sum.loglikelihood) x.threshold - 0.63 loglikelihood.63 - log(1/(x-x.threshold) * dnorm(log(x - x.threshold), mean(log(x - x.threshold)), sd(log(x - x.threshold sum.loglikelihood.63 - sum(loglikelihood.63) print(sum.loglikelihood.63) x.minus.x.threshold - x - x.threshold plot(loglikelihood.63 ~ x.minus.x.threshold, xlim = c(0, 2), ylim =c(-10, 2)) points(x, loglikelihood, col=red) log.likelihiood.ratio - sum.loglikelihood.63 - sum.loglikelihood print(log.likelihiood.ratio) significant.difference - qchisq(p = 0.95, df = 1)/2 print(significant.difference) Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Charles Annis, P.E. Sent: Sunday, April 05, 2009 10:39 AM To: 'Mike Lawrence'; t...@centroin.com.br Cc: 'r-help' Subject: Re: [R] threshold distribution The data suggest a lognormal threshold to me (and perhaps to the originator, based on his title). ## x - c(0.80010, 0.72299, 0.69893, 0.99597, 0.89200, 0.69312, 0.73613, 1.13559, 0.85009, 0.85804, 0.73324, 1.04826, 0.84002, 1.76330, 0.71980, 0.89416, 0.89450, 0.98670, 0.83571, 0.73833, 0.66549, 0.93641, 0.80418, 0.95285, 0.76876, 0.82588, 1.09394, 1.00195, 1.14976, 0.80008, 1.11947, 1.09484, 0.81494, 0.68696, 0.82364, 0.84390, 0.71402, 0.80293, 1.02873) # plot the original density x.threshold - 0 qqnorm(log(x - x.threshold), datax = TRUE) qqline(log(x - x.threshold), datax = TRUE) # plot the lognormal density with a threshold x.threshold - 0.63 qqnorm(log(x - x.threshold), datax = TRUE) qqline(log(x - x.threshold), datax = TRUE) # compute and plot the associated log likelihoods x.threshold - 0 loglikelihood - 1/(x-x.threshold) * dnorm(log(x - x.threshold), mean(log(x - x.threshold)), sd(log(x - x.threshold))) x.threshold - 0.63 loglikelihood.63 - 1/(x-x.threshold) * dnorm(log(x - x.threshold), mean(log(x - x.threshold)), sd(log(x - x.threshold))) x.minus.x.threshold - x - x.threshold plot(x.minus.x.threshold, loglikelihood.63, xlim = c(0, 2), ylim =c(0, 3.5)) points(x, loglikelihood, col=red) # compare loglikelihood ratio with chi-square sum.loglikelihood - sum(loglikelihood) print(sum.loglikelihood) sum.loglikelihood.63 - sum(loglikelihood.63) print(sum.loglikelihood.63) log.likelihiood.ratio - sum.loglikelihood.63 - sum.loglikelihood print(log.likelihiood.ratio) significant.difference - qchisq(p = 0.95, df = 1)/2 print(significant.difference) # Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mike Lawrence Sent: Sunday, April 05, 2009 8:13 AM To: t...@centroin.com.br Cc: r-help Subject: Re: [R] threshold distribution You didn't properly specify the x-axis coordinates in your call to lines(): plot(density(x)) lines(x,dlnorm(x, -.1348, .1911), col='red') points(x,dlnorm(x, -.1348, .1911), col='blue') curve(dlnorm(x, -.1348, .1911), col='green',add=T) On Sun, Apr 5, 2009 at 6:40 AM, Bernardo Rangel Tura t...@centroin.com.br wrote: On Sun, 2009-04-05 at 01:13 -0400, jim holtman wrote: Here is what I get from using 'fitdistr' in R to fit to a lognormal. The resulting density plot from the distribution seems to be a reason match to the data. x - scan() 1: 0.80010 0.72299 0.69893 0.99597 0.89200 0.69312 0.73613 1.13559 9: 0.85009 0.85804 0.73324 1.04826 0.84002 14: 1.76330 0.71980 0.89416 0.89450 0.98670 0.83571 0.73833 0.66549 22: 0.93641 0.80418 0.95285 0.76876 0.82588 27: 1.09394 1.00195 1.14976 0.80008 1.11947 1.09484 0.81494 0.68696 35: 0.82364 0.84390 0.71402 0.80293 1.02873 40: Read 39 items plot(density(x)) library(MASS) fitdistr(x, 'lognormal') meanlog sdlog -0.13480636 0.19118861 ( 0.03061468) ( 0.02164785) lines(dlnorm(x, -.1348, .1911), col='red') Hi Jim I agree with your solution but my plot result not fine. I obtain same result. fitdistr(x, 'lognormal') meanlog sdlog -0.13480636 0.19118861 ( 0.03061468) ( 0.02164785) In plot when I use points (blue) and curve (green) the fit o lognormal and density(data) is fine but when I use lines (red) the fit is bad (in attach I send a PDF of my output) Do you know why this happen? Thanks in advance -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil P.S. my script is x - scan
Re: [R] Linear model, finding the slope
I'm not sure what you are doing when you Normalize. Would you explain? To see if the slope is significant, look at the model summary, in your example: summary(model) Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Melissa2k9 Sent: Friday, April 03, 2009 5:51 AM To: r-help@r-project.org Subject: [R] Linear model, finding the slope Hi for some data I working on I am merely plotting time against temperature for a variable named filmclip. So for example, I have volunteers who watched various film clips and have used infared camera to monitor the temperature on their face at every second of the clip. The variable names I have used are Normalised ( for the temperature) and Frame (for the time in seconds). So I have fitted a linear model model-lm(Normalised~Frame,data=All,subset=((Subject==1)(Filmclip==Whateve r) and coef(model) gives me an intercept value and a value for the slope. Now what I want to do is find out if the slope is significant or not. So far I just have values such as 0.02211 for example and have no idea if this is to be interpreted as significant or not. Sorry if I haven't been clear but any advice on how to find out what values are significant would be greatly appreciated. -- View this message in context: http://www.nabble.com/Linear-model%2C-finding-the-slope-tp22865254p22865254. html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to set up a function for Central Limit Theorem
Ivan: While you're figuring out how to execute the CLT in R you may find my automated examples informative. http://StatisticalEngineering.com/central_limit_theorem.htm Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of pfc_ivan Sent: Monday, March 23, 2009 1:31 PM To: r-help@r-project.org Subject: [R] How to set up a function for Central Limit Theorem Hello guys, I am stuck here: How do I make 1000 samples of n = 10 observations from an Exponential distribution and then compute the mean for all those 1000 samples? Basically I need to prove the Central Limit theorem, which states: http://www.nabble.com/file/p22664113/d175f06cbf200bd52a2c27a2e56dc594.png Where the Sn is sum of random variables, n we have from the question, mu is mean and (sigma)^2 is variance. I am having trouble setting up the function to do this. Any help apreciated! -- View this message in context: http://www.nabble.com/How-to-set-up-a-function-for-%22Central-Limit-Theorem% 22-tp22664113p22664113.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] which.na
?is.na x - c(NA, 3, 4, 5, NA) which(is.na(x)) [1] 1 5 Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Santosh Sent: Thursday, March 19, 2009 9:37 PM To: r-help@r-project.org Subject: [R] which.na Hi R- users I was wondering if there is any function equivalent to which.na used in S+? Thanks much in advance! Regards, Santosh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Cannot update 2.8.1 packages: unable to access index forrepository...
Are you using Microsoft OneCare? I had a similar problem accessing CRAN (actually setting a CRAN mirror) several weeks ago with R2.8.1 while R2.6.2 could access CRAN with no difficulties. Even running R as Administrator wouldn't work. The problem proved to be that OneCare had asked for my permission to let R2.8.1 access the internet, but I missed the request (the window was buried elsewhere). Several days later the request again surfaced, I OKed the internet access and all the problems vanished. Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Marcus, Jeffrey Sent: Monday, March 09, 2009 1:07 PM To: r-help@r-project.org Subject: [R] Cannot update 2.8.1 packages: unable to access index forrepository... I am having trouble updating packages for R 2.8.1 in Windows XP. Note that I *am* able to update packages for R 2.7.0 (see bottom of posting) so this is not an Internet proxy problem. The steps I took were to (a) Copy over packages from my existing (2.7.0) library subdiretory to the R 2.8.1 library subdirectory. This included a long list of packages including RODBC, rpart, RGraphViz, ggplot2 and their dependents. (b) From within Rgui, run update.packages(ask='graphics') I tried this several times with different repositories and mirrors and each time got messages like: Warning: unable to access index for repository http://streaming.stat.iastate.edu/CRAN/bin/windows/contrib/2.8 Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2. Warning: unable to access index for repository http://www.omegahat.org/R/bin/windows/contrib/2.8 Warning: unable to access index for repository http://cran.fhcrc.org/bin/windows/contrib/2.8 Finally, I noticed that a recent R-help thread http://www.nabble.com/Installing-the-Rstem-package-td22357873.html#a22362058 Includes the following comment (excerpted) from Professor Brian Ripley a) There seem to be no Windows binaries on Omegahat for R 2.7. b) A few are available from CRAN extras (one of the default repositories on Window), and I've added Rstem. So please try again now. Does this mean that I should update 2.8.0 libraries from zip files manually? Or is there a more convenient workaround for updating? By the way, here is what I see with R 2.7.0 update.packages(ask='graphics') trying URL 'http://streaming.stat.iastate.edu/CRAN/bin/windows/contrib/2.7/RODBC_1.2-4. zip' Content type 'application/zip' length 195082 bytes (190 Kb) opened URL downloaded 190 Kb package 'RODBC' successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package 'RODBC' The downloaded packages are in C:\Documents and Settings\jmarcus\Local Settings\Temp\Rtmp5QBblK\downloaded_packages updating HTML package descriptions Thanks for any help JEFF MARCUS Manager, Applied Data Analysis NUANCE COMMUNICATIONS, INC. One Wayside Road Burlington MA 01803 781 565 5000 Office 781-565 5001 Fax NUANCE.COM The experience speaks for itself (tm) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] FW: Can't access CRAN
Dear R-Helpers: I'm running R version 2.8.1 on a 1 year old HP Pavilion with a AMD Athelon 64 Dual Core Processor 4800+ 2.50GHz chip, Vista Home Premium SP1, and 2 GB RAM. I can't add packages (even running as Administrator) because I can't connect to a CRAN mirror. chooseCRANmirror() (After nearly a minute I see the menu, and after any selection I immediately see) Warning message: In open.connection(con, r) : unable to connect to 'cran.r-project.org' on port 80. BUT - I also have R 2.6.2 installed on this machine. It works perfectly. Consulting the FAQ I tried changing permissions but no-go, plus the permissions on R 2.6.2 and R 2.8.1 appear to be identical. I'm baffled. Can anyone illuminate this situation? Thanks Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] cannot load package splines
Greetings R-Helpers: I am trying to help a Chinese colleague who is experiencing difficulty loading my package. He is running WindowsXP and the Chinese version of R2.8.1. As you can see from his screen-copy (below), my package is successfully unpacked but cannot be loaded because splines balks when attempted to be loaded. Package mh1823 requires package survival, which in turn requires splines. utils:::menuInstallLocal() package 'mh1823' successfully unpacked and MD5 sums checked updating HTML package descriptions local({pkg - select.list(sort(.packages(all.available = TRUE))) + if(nchar(pkg)) library(pkg, character.only=TRUE)}) Loading required package: rcom Loading required package: rscproxy Loading required package: RODBC Loading required package: RColorBrewer Loading required package: survival Loading required package: splines Error in parse(n = -1, file = file) : invalid multibyte character in parser at line 33 $B:x8m(B: unable to load R code in package 'mh1823' Any suggestions are welcome. Thank you. Charles Annis, P.E. mailto:charles.an...@statisticalengineering.com charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] HOW to provide a CITATION file?
Many thanks to Henrik and Spencer, Professor Ripley, and others. The trick that I had missed (found in 'Writing R Extensions') is that the CITATION file must be located in the 'inst' subdirectory of the package sources. Again, my gratitude to all. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Henrik Bengtsson Sent: Saturday, November 15, 2008 8:28 PM To: [EMAIL PROTECTED] Cc: r-help@r-project.org Subject: Re: [R] HOW to provide a CITATION file? See 'Writing R Extensions' via help.start() and then search for CITATION. My $.02 /Henrik On Sat, Nov 15, 2008 at 2:35 PM, Charles Annis, P.E. [EMAIL PROTECTED] wrote: Greetings, R-ians: I am sure I am missing something obvious. How do I provide a CITATION file for my home-brew package, so that it will be packaged using R CMD build --binary myPackage? I have placed a CITATION file in the myPackage directory along with the DESCRIPTION file, but it is ignored. Thanks for your guidance. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] HOW to provide a CITATION file?
Greetings, R-ians: I am sure I am missing something obvious. How do I provide a CITATION file for my home-brew package, so that it will be packaged using R CMD build --binary myPackage? I have placed a CITATION file in the myPackage directory along with the DESCRIPTION file, but it is ignored. Thanks for your guidance. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] trouble with character \u00e2
Thank you, Professor Ripley: Your example works for me too. plot(1:10, xlab = a, ylab = â) file.label - EXAMPLE 1 â vs a.xls savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) But, if I read-in the file name using file.choose() I get the same corrupted output filename ( diagnostic â vs a EXAMPLE 1 â vs a.xls.jpg ) from my R routines. However, if I paste that same file.label as it is printed to the screen with my input routine, replacing your foo (as above) things work as they should ( diagnostic â vs a EXAMPLE 1 â vs a.xls.jpg ). Furthermore, if I again run my plotting routines after your example (like that here, above), my routines no longer produce corrupted filenames for the saved plots. The trouble seems to be caused by my how I read-in the file name. Here is a simple example that produces a corrupted file name for the saved plot: plot(1:10, xlab = a, ylab = â) file.name - file.choose() print(file.name) file.label - basename(file.name) savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) The name of my input Excel file is EXAMPLE 1 â vs a.xls The problem does not occur on R R2.7.0 I am running R2.7.2 on a 5 year old DELL box (2 Gig RAM, 3GHz Pentium 4) with Windows XP, and have also experienced the problem on my Thinkpad laptop (2 Gig, Intel Core2 Duo, 1.6GHz) running Vista. Thank you for your counsel. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 4:39 AM To: Charles Annis, P.E. Cc: r-help@r-project.org Subject: Re: [R] trouble with character \u00e2 You haven't given any of the information asked for in the posting guide. But, assuming this is Windows in CP1252 (as I believe that has been your locale before), it works for me in current R. plot(1:10) file.label - foo savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) If you are not using 2.8.0 beta or 2.7.2 patched, please check those. This might be related to o file.path() did not work correctly in 2.7.0 if the components had different encodings. (NEWS for 2.7.1). On Sun, 5 Oct 2008, Charles Annis, P.E. wrote: Greetings R-wizards: For historical reasons I have filenames with the character â and have successfully used \u00e2 in its place, with the hoped-for result on all my on-screen plots. However since R2.7.0 I have trouble with savePlot() when the file name includes that character as it does in this example: savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) In R2.6.0 and earlier, R would ignore a dot ('.') in the file name and supply the extension. Since R2.7.0 if filename does include a dot, savePlot() will not add the file type as an extension. Thus my apparent redundancy in the file name. The problem I have is that the example command will substitute an unwanted character for â, yet if I use File, save as, jpg ... and type in a name containing the troublesome character, R saves the on-screen plot with that character in the name with no complaints. I have tried using iconv() with no success, as can be seen with the following code: file.name - paste(diagnostic â vs a , file.label, .jpg, sep = ) iconv.List - iconvlist() for(encoding in iconv.List) { print(iconv(file.name, , encoding, ))} So, here's the question: How can I save, with a non-interactive R command, an existing plot with the troublesome character in the file name? Thanks. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] trouble with character \u00e2
Thank you Professor: After reading in the file this is what I see: file.label [1] EXAMPLE 1 â vs a.xls charToRaw(file.label) [1] 45 58 41 4d 50 4c 45 20 31 20 c3 a2 20 76 73 20 61 2e 78 6c 73 Encoding(file.label) [1] UTF-8 Encoding(paste(diagnostic â vs a , file.label, .jpg, sep = )) [1] UTF-8 But look what happens after I run your example: charToRaw(file.label) [1] 45 58 41 4d 50 4c 45 20 31 20 e2 20 76 73 20 61 2e 78 6c 73 (after) [1] 45 58 41 4d 50 4c 45 20 31 20 c3 a2 20 76 73 20 61 2e 78 6c 73 (before) The file label appears on the screen as it does above both times, but clearly charToRaw() shows that the coding for â has changed from the unexpected c3 a2, to the desired e2. After running your example I now observe Encoding(file.label) [1] latin1 Again, thank you for your help. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 10:32 AM To: Charles Annis, P.E. Cc: r-help@r-project.org Subject: RE: [R] trouble with character \u00e2 That also works without a hitch on my box, even in vanilla 2.7.2. What exactly is in file.label as given by charToRaw(file.label) Encoding(file.label) ? It should be in UTF-8, and so should paste(diagnostic â vs a , file.label, .jpg, sep = ) It looks like the latter is not being treated as UTF-8 on your system (see what Encoding() says on its value). On Wed, 8 Oct 2008, Charles Annis, P.E. wrote: Thank you, Professor Ripley: Your example works for me too. plot(1:10, xlab = a, ylab = â) file.label - EXAMPLE 1 â vs a.xls savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) But, if I read-in the file name using file.choose() I get the same corrupted output filename ( diagnostic â vs a EXAMPLE 1 â vs a.xls.jpg ) from my R routines. However, if I paste that same file.label as it is printed to the screen with my input routine, replacing your foo (as above) things work as they should ( diagnostic â vs a EXAMPLE 1 â vs a.xls.jpg ). Furthermore, if I again run my plotting routines after your example (like that here, above), my routines no longer produce corrupted filenames for the saved plots. The trouble seems to be caused by my how I read-in the file name. Here is a simple example that produces a corrupted file name for the saved plot: plot(1:10, xlab = a, ylab = â) file.name - file.choose() print(file.name) file.label - basename(file.name) savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) The name of my input Excel file is EXAMPLE 1 â vs a.xls The problem does not occur on R R2.7.0 I am running R2.7.2 on a 5 year old DELL box (2 Gig RAM, 3GHz Pentium 4) with Windows XP, and have also experienced the problem on my Thinkpad laptop (2 Gig, Intel Core2 Duo, 1.6GHz) running Vista. Thank you for your counsel. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 4:39 AM To: Charles Annis, P.E. Cc: r-help@r-project.org Subject: Re: [R] trouble with character \u00e2 You haven't given any of the information asked for in the posting guide. But, assuming this is Windows in CP1252 (as I believe that has been your locale before), it works for me in current R. plot(1:10) file.label - foo savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) If you are not using 2.8.0 beta or 2.7.2 patched, please check those. This might be related to o file.path() did not work correctly in 2.7.0 if the components had different encodings. (NEWS for 2.7.1). On Sun, 5 Oct 2008, Charles Annis, P.E. wrote: Greetings R-wizards: For historical reasons I have filenames with the character â and have successfully used \u00e2 in its place, with the hoped-for result on all my on-screen plots. However since R2.7.0 I have trouble with savePlot() when the file name includes that character as it does in this example: savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) In R2.6.0 and earlier, R would ignore a dot ('.') in the file name and supply the extension. Since R2.7.0 if filename does include a dot, savePlot() will not add the file type as an extension. Thus my apparent redundancy in the file name. The problem I have is that the example command will substitute an unwanted character for â, yet if I use File, save as, jpg ... and type in a name containing the troublesome character, R saves the on-screen plot with that character in the name with no complaints. I have tried using iconv() with no success, as can be seen with the following code: file.name - paste(diagnostic â vs a , file.label, .jpg, sep
Re: [R] trouble with character \u00e2
Thank you Professor: Here is an example using R2.8.0 beta. It shows the coding to be latin1 I installed my package which requires rcom, RODBC, RColorBrewer, survival I was unable to find rcom in the packages drop-down menu. I tried mirrors USA(PA) and USA(PA2). rcom does appear in the menu run under R2.7.2, however. __ R version 2.8.0 beta (2008-10-07 r46631) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. ls() character(0) file.label - EXAMPLE 1 â vs a.xls charToRaw(file.label) [1] 45 58 41 4d 50 4c 45 20 31 20 e2 20 76 73 20 61 2e 78 6c 73 Encoding(file.label) [1] latin1 Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 2:20 PM To: Charles Annis, P.E. Subject: RE: [R] trouble with character \u00e2 On Wed, 8 Oct 2008, Charles Annis, P.E. wrote: Professor Ripley: Can I get the Windows binaries for R2.8.0 beta? I looked earlier today and found the tar files but not any binaries. http://cran.r-project.org/src/base-prerelease/ http://cran.r-project.org/bin/windows/base/rtest.html or look via Windows. Thank you. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 1:10 PM To: Charles Annis, P.E. Cc: r-help@r-project.org Subject: RE: [R] trouble with character \u00e2 Can you please try a 2.8.0 beta build? I have a suspicion as to what might be going on, and it cannot happen there. If my guess is correct, nfile - paste(diagnostic â vs a , file.label, .jpg, sep = ) savePlot(path.expand(nfile), type=jpg) may work for you in 2.7.2 (but as I said, I wasn't able to reproduce this there). The crucial bit is to use path.expand() on the final file name: it will do nothing except ensure that the encoding is correct. On Wed, 8 Oct 2008, Charles Annis, P.E. wrote: Thank you Professor: After reading in the file this is what I see: file.label [1] EXAMPLE 1 â vs a.xls charToRaw(file.label) [1] 45 58 41 4d 50 4c 45 20 31 20 c3 a2 20 76 73 20 61 2e 78 6c 73 Encoding(file.label) [1] UTF-8 Encoding(paste(diagnostic â vs a , file.label, .jpg, sep = )) [1] UTF-8 But look what happens after I run your example: charToRaw(file.label) [1] 45 58 41 4d 50 4c 45 20 31 20 e2 20 76 73 20 61 2e 78 6c 73 (after) [1] 45 58 41 4d 50 4c 45 20 31 20 c3 a2 20 76 73 20 61 2e 78 6c 73 (before) The file label appears on the screen as it does above both times, but clearly charToRaw() shows that the coding for â has changed from the unexpected c3 a2, to the desired e2. After running your example I now observe Encoding(file.label) [1] latin1 Again, thank you for your help. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 10:32 AM To: Charles Annis, P.E. Cc: r-help@r-project.org Subject: RE: [R] trouble with character \u00e2 That also works without a hitch on my box, even in vanilla 2.7.2. What exactly is in file.label as given by charToRaw(file.label) Encoding(file.label) ? It should be in UTF-8, and so should paste(diagnostic â vs a , file.label, .jpg, sep = ) It looks like the latter is not being treated as UTF-8 on your system (see what Encoding() says on its value). On Wed, 8 Oct 2008, Charles Annis, P.E. wrote: Thank you, Professor Ripley: Your example works for me too. plot(1:10, xlab = a, ylab = â) file.label - EXAMPLE 1 â vs a.xls savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) But, if I read-in the file name using file.choose() I get the same corrupted output filename ( diagnostic â vs a EXAMPLE 1 â vs a.xls.jpg ) from my R routines. However, if I paste that same file.label as it is printed to the screen with my input routine, replacing your foo (as above) things work as they should ( diagnostic â vs a EXAMPLE 1 â vs a.xls.jpg ). Furthermore, if I again run my plotting routines after your example (like that here, above), my
Re: [R] trouble with character \u00e2
Professor Ripley: I'm sorry. I misunderstood. R version 2.8.0 beta (2008-10-07 r46631) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. file.label - EXAMPLE 1 â vs a.xls plot(1:10, xlab = a, ylab = â) savePlot(paste(diagnostic â vs a , file.label, .jpg, + sep = ), type = jpg) charToRaw(file.label) [1] 45 58 41 4d 50 4c 45 20 31 20 e2 20 76 73 20 61 2e 78 6c 73 Encoding(file.label) [1] latin1 plot(1:10, xlab = a, ylab = â) file.name - file.choose() print(file.name) [1] C:\\Documents and Settings\\Charles Annis\\My Documents\\R Projects\\mh1823 R2.8.0 beta\\EXAMPLE 2 â vs a repeated measures.xls file.label - basename(file.name) savePlot(paste(diagnostic â vs a , file.label, .jpg, + sep = ), type = jpg) Encoding(file.label) [1] UTF-8 In both cases the saved file had the hoped-for result. I will try to load my package in R2.8.0 as soon as I can find package:rcom that it requires. Thank you. It appears that R2.8.0 will produce the desired results. When I run this script in R2.7.2 the second saved file has a corrupted name. Thank you again. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 5:02 PM To: Charles Annis, P.E. Cc: r-help@r-project.org Subject: RE: [R] trouble with character \u00e2 On Wed, 8 Oct 2008, Charles Annis, P.E. wrote: Thank you Professor: Here is an example using R2.8.0 beta. It shows the coding to be latin1 But you did not use file.choose or basename here. I installed my package which requires rcom, RODBC, RColorBrewer, survival I was unable to find rcom in the packages drop-down menu. I tried mirrors USA(PA) and USA(PA2). rcom does appear in the menu run under R2.7.2, however. __ R version 2.8.0 beta (2008-10-07 r46631) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. ls() character(0) file.label - EXAMPLE 1 â vs a.xls charToRaw(file.label) [1] 45 58 41 4d 50 4c 45 20 31 20 e2 20 76 73 20 61 2e 78 6c 73 Encoding(file.label) [1] latin1 Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 2:20 PM To: Charles Annis, P.E. Subject: RE: [R] trouble with character \u00e2 On Wed, 8 Oct 2008, Charles Annis, P.E. wrote: Professor Ripley: Can I get the Windows binaries for R2.8.0 beta? I looked earlier today and found the tar files but not any binaries. http://cran.r-project.org/src/base-prerelease/ http://cran.r-project.org/bin/windows/base/rtest.html or look via Windows. Thank you. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 1:10 PM To: Charles Annis, P.E. Cc: r-help@r-project.org Subject: RE: [R] trouble with character \u00e2 Can you please try a 2.8.0 beta build? I have a suspicion as to what might be going on, and it cannot happen there. If my guess is correct, nfile - paste(diagnostic â vs a , file.label, .jpg, sep = ) savePlot(path.expand(nfile), type=jpg) may work for you in 2.7.2 (but as I said, I wasn't able to reproduce this there). The crucial bit is to use path.expand() on the final file name: it will do nothing except ensure that the encoding is correct. On Wed, 8 Oct 2008, Charles Annis, P.E. wrote: Thank you Professor: After reading in the file this is what I see: file.label [1] EXAMPLE 1 â vs a.xls charToRaw(file.label
Re: [R] trouble with character \u00e2
PS - After installing rcom from CRAN as a zipped binary, my home-brew package runs on R2.8.0 beta as it did on r releases before R2.7.x Thank you, Professor Ripley. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charles Annis, P.E. Sent: Wednesday, October 08, 2008 5:38 PM To: 'Prof Brian Ripley' Cc: r-help@r-project.org Subject: Re: [R] trouble with character \u00e2 Professor Ripley: I'm sorry. I misunderstood. R version 2.8.0 beta (2008-10-07 r46631) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. file.label - EXAMPLE 1 â vs a.xls plot(1:10, xlab = a, ylab = â) savePlot(paste(diagnostic â vs a , file.label, .jpg, + sep = ), type = jpg) charToRaw(file.label) [1] 45 58 41 4d 50 4c 45 20 31 20 e2 20 76 73 20 61 2e 78 6c 73 Encoding(file.label) [1] latin1 plot(1:10, xlab = a, ylab = â) file.name - file.choose() print(file.name) [1] C:\\Documents and Settings\\Charles Annis\\My Documents\\R Projects\\mh1823 R2.8.0 beta\\EXAMPLE 2 â vs a repeated measures.xls file.label - basename(file.name) savePlot(paste(diagnostic â vs a , file.label, .jpg, + sep = ), type = jpg) Encoding(file.label) [1] UTF-8 In both cases the saved file had the hoped-for result. I will try to load my package in R2.8.0 as soon as I can find package:rcom that it requires. Thank you. It appears that R2.8.0 will produce the desired results. When I run this script in R2.7.2 the second saved file has a corrupted name. Thank you again. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 5:02 PM To: Charles Annis, P.E. Cc: r-help@r-project.org Subject: RE: [R] trouble with character \u00e2 On Wed, 8 Oct 2008, Charles Annis, P.E. wrote: Thank you Professor: Here is an example using R2.8.0 beta. It shows the coding to be latin1 But you did not use file.choose or basename here. I installed my package which requires rcom, RODBC, RColorBrewer, survival I was unable to find rcom in the packages drop-down menu. I tried mirrors USA(PA) and USA(PA2). rcom does appear in the menu run under R2.7.2, however. __ R version 2.8.0 beta (2008-10-07 r46631) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. ls() character(0) file.label - EXAMPLE 1 â vs a.xls charToRaw(file.label) [1] 45 58 41 4d 50 4c 45 20 31 20 e2 20 76 73 20 61 2e 78 6c 73 Encoding(file.label) [1] latin1 Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 2:20 PM To: Charles Annis, P.E. Subject: RE: [R] trouble with character \u00e2 On Wed, 8 Oct 2008, Charles Annis, P.E. wrote: Professor Ripley: Can I get the Windows binaries for R2.8.0 beta? I looked earlier today and found the tar files but not any binaries. http://cran.r-project.org/src/base-prerelease/ http://cran.r-project.org/bin/windows/base/rtest.html or look via Windows. Thank you. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 1:10 PM To: Charles Annis, P.E. Cc: r-help@r-project.org Subject: RE: [R] trouble with character \u00e2 Can you please try a 2.8.0 beta build? I have a suspicion as to what might be going on, and it cannot
[R] trouble with character \u00e2
Greetings R-wizards: For historical reasons I have filenames with the character â and have successfully used \u00e2 in its place, with the hoped-for result on all my on-screen plots. However since R2.7.0 I have trouble with savePlot() when the file name includes that character as it does in this example: savePlot(paste(diagnostic â vs a , file.label, .jpg, sep = ), type = jpg) In R2.6.0 and earlier, R would ignore a dot ('.') in the file name and supply the extension. Since R2.7.0 if filename does include a dot, savePlot() will not add the file type as an extension. Thus my apparent redundancy in the file name. The problem I have is that the example command will substitute an unwanted character for â, yet if I use File, save as, jpg ... and type in a name containing the troublesome character, R saves the on-screen plot with that character in the name with no complaints. I have tried using iconv() with no success, as can be seen with the following code: file.name - paste(diagnostic â vs a , file.label, .jpg, sep = ) iconv.List - iconvlist() for(encoding in iconv.List) { print(iconv(file.name, , encoding, ))} So, here's the question: How can I save, with a non-interactive R command, an existing plot with the troublesome character in the file name? Thanks. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] gsub difficulty
Greetings R-ians: I know what doesnt work but I dont know why, nor how to remedy things. I have a character string containing . which I want to replace with gsub(., , file.label) replaces the every character with a blank. However gsub(.xls, , file.label) replaces .xls with a blank as expected. It appears that . is some kind of wild-card. How do I tell gsub that a period is just a period? Thanks. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] gsub difficulty
Thanks! Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Phil Spector [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2008 1:30 PM To: Charles Annis, P.E. Subject: Re: [R] gsub difficulty Charles - Here are two ways: string = 'one.two.three' gsub('\\.',' ',string) [1] one two three gsub('.',' ',string,fixed=TRUE) [1] one two three - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley [EMAIL PROTECTED] On Tue, 23 Sep 2008, Charles Annis, P.E. wrote: Greetings R-ians: I know what doesn?t work but I don?t know why, nor how to remedy things. I have a character string containing . which I want to replace with gsub(., , file.label) replaces the every character with a blank. However gsub(.xls, , file.label) replaces .xls with a blank as expected. It appears that . is some kind of wild-card. How do I tell gsub that a period is just a period? Thanks. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] gsub difficulty
Thanks, Jorge, for another alternative. Charles Annis, P.E. mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com _ From: Jorge Ivan Velez [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2008 2:21 PM To: [EMAIL PROTECTED] Subject: Re: [R] gsub difficulty Dear Charles, Phil Spector answered your original question by using two different approaches, but here I'm going again :) x=your.string.is.here gsub([.], ,x) [1] your string is here HTH, Jorge On Tue, Sep 23, 2008 at 1:23 PM, Jorge Ivan Velez [EMAIL PROTECTED] wrote: Deat Charles, Is this what you want? x=.xls sub(.,,x) [1] xls HTH, Jorge On Tue, Sep 23, 2008 at 1:16 PM, Charles Annis, P.E. [EMAIL PROTECTED] wrote: Greetings R-ians: I know what doesn't work but I don't know why, nor how to remedy things. I have a character string containing . which I want to replace with gsub(., , file.label) replaces the every character with a blank. However gsub(.xls, , file.label) replaces .xls with a blank as expected. It appears that . is some kind of wild-card. How do I tell gsub that a period is just a period? Thanks. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to learn R language?
There are many books, but if I had to choose one that teaches R and teaches statistics at the same time (Yes, you already know stats, so it will be that much easier) I'd choose Peter Dalgaard's book, Introductory Statistics with R. It's exceptionally well written, easy to follow, and will systematically teach you R. It's paperback, not too expensive and available at Amazon. Start at the front, work all the way through it and you will be delighted with the results. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of saggak Sent: Wednesday, August 27, 2008 6:07 AM To: r-help@r-project.org Subject: [R] How to learn R language? Hi! I am a post graduate in Statistics. I want to learn R language, but am very confused as to how to begin systematically. I need to learn R language from Statistics point of view e.g. I need to fit distributions to data or run regression analysis etc. No doubt there are so many articles available on internet. But can someone guide me as to how do I begin and go on improving myself SYSTEMATICALLY? Hence, please guide me as to how should I start learning R language? What should I read first etc. Thanks in advance, Sagga K Did you know? You can CHAT without downloading messenger. Go to http://in.webmessenger.yahoo.com/ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] help with my sloppy syntax
R-ians: After some effort I coerced my code to do what I want but my syntax is a kludge. Suggestions on more elegant syntax? par - NIM.results$par do.call(Draw.NIM.POD.curve, list(par[1], par[2], par[3], par[4], par[5], a.hat.decision, et cetera ... It seems that I should be able to avoid defining the variable par and then specifying each of its elements, but all my attempts resulted in a list whose first element is a list, rather than the elements of the list. And my attempts at unlist were unsuccessful. Thank you. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help with my sloppy syntax
Professor Ripley: Not quite. Here is what works, followed by what doesn't: What works: par - NIM.results$par list(par[1], par[2], par[3], par[4], par[5], a.hat.decision, noise.threshold, a.hat.vs.a.data) [[1]] [1] 16.91573 [[2]] [1] 0.9176942 [[3]] [1] 1.715070 [[4]] [1] 39.69884 [[5]] [1] 2.037159 [[6]] [1] 50 [[7]] [1] 50 [[8]] size a.hat 1 10.0 37.34855 2 10.8 45.43194 and the list continues for 101 elements ### What doesn't work: (notice the difference in structure for the first 5 elements) list(as.list(NIM.results$par), a.hat.decision, noise.threshold, signal.Y, noise.Y, list(a.hat.vs.a.data)) [[1]] [[1]][[1]] [1] 16.91573 [[1]][[2]] [1] 0.9176942 [[1]][[3]] [1] 1.715070 [[1]][[4]] [1] 39.69884 [[1]][[5]] [1] 2.037159 [[2]] [1] 50 [[3]] [1] 50 [[4]] [1] 60 [[5]] [1] 40 [[6]] [[6]][[1]] size a.hat 1 10.0 37.34855 2 10.8 45.43194 ### The first works with my do.call; the second balks with this result: do.call(Draw.NIM.POD.curve, list(as.list(NIM.results$par), a.hat.decision, noise.threshold, signal.Y, noise.Y, list(a.hat.vs.a.data))) Error in a.hat.decision - b0 : non-numeric argument to binary operator Thank you for your counsel. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley Sent: Thursday, August 14, 2008 11:48 AM To: Charles Annis, P.E. Cc: r-help@r-project.org; [EMAIL PROTECTED] Subject: Re: [R] help with my sloppy syntax On Thu, 14 Aug 2008, Charles Annis, P.E. wrote: Thank you Professor Ripley: From your response it is clear that I left out something important, for which I apologize. Part of the et cetera is another list. Your method, which would work otherwise, also converts the other list to its members. The program being called has an argument list like (a, b, c, d, e, w, x, y, z) where z is a list but the other elements are single variables (not lists or vectors). Does using list(z) inside c() work? If I understand you correctly it will. I have the values of (a, b, c, d, e) returned from the R function optim as results$par. I wish to call my function with those values, some others, and finally with that other list, z. Is there a way to do this without defining another variable var and listing its elements without the undesirable unlisting that terminal variable z? Thank you. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley Sent: Thursday, August 14, 2008 11:20 AM To: Charles Annis, P.E. Cc: r-help@r-project.org; [EMAIL PROTECTED] Subject: Re: [R] help with my sloppy syntax Try c(as.list(par), a.hat.decision, et cetera ...) We are guessing what any of these are, of course. On Thu, 14 Aug 2008, Charles Annis, P.E. wrote: R-ians: After some effort I coerced my code to do what I want but my syntax is a kludge. Suggestions on more elegant syntax? par - NIM.results$par do.call(Draw.NIM.POD.curve, list(par[1], par[2], par[3], par[4], par[5], a.hat.decision, et cetera ... It seems that I should be able to avoid defining the variable par and then specifying each of its elements, but all my attempts resulted in a list whose first element is a list, rather than the elements of the list. And my attempts at unlist were unsuccessful. Thank you. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help with my sloppy syntax
Right you are! Thank you for finding my mistake. I have been trying all sorts of combinations and I just dropped the ball. Thank you and thanks to Professor Ripley! Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Patrick Burns [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2008 1:19 PM To: [EMAIL PROTECTED] Subject: Re: [R] help with my sloppy syntax You need to look again at what you were told to try. Hint: 'c' is not 'list'. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) Charles Annis, P.E. wrote: Professor Ripley: Not quite. Here is what works, followed by what doesn't: What works: par - NIM.results$par list(par[1], par[2], par[3], par[4], par[5], a.hat.decision, noise.threshold, a.hat.vs.a.data) [[1]] [1] 16.91573 [[2]] [1] 0.9176942 [[3]] [1] 1.715070 [[4]] [1] 39.69884 [[5]] [1] 2.037159 [[6]] [1] 50 [[7]] [1] 50 [[8]] size a.hat 1 10.0 37.34855 2 10.8 45.43194 and the list continues for 101 elements ### What doesn't work: (notice the difference in structure for the first 5 elements) list(as.list(NIM.results$par), a.hat.decision, noise.threshold, signal.Y, noise.Y, list(a.hat.vs.a.data)) [[1]] [[1]][[1]] [1] 16.91573 [[1]][[2]] [1] 0.9176942 [[1]][[3]] [1] 1.715070 [[1]][[4]] [1] 39.69884 [[1]][[5]] [1] 2.037159 [[2]] [1] 50 [[3]] [1] 50 [[4]] [1] 60 [[5]] [1] 40 [[6]] [[6]][[1]] size a.hat 1 10.0 37.34855 2 10.8 45.43194 ### The first works with my do.call; the second balks with this result: do.call(Draw.NIM.POD.curve, list(as.list(NIM.results$par), a.hat.decision, noise.threshold, signal.Y, noise.Y, list(a.hat.vs.a.data))) Error in a.hat.decision - b0 : non-numeric argument to binary operator Thank you for your counsel. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley Sent: Thursday, August 14, 2008 11:48 AM To: Charles Annis, P.E. Cc: r-help@r-project.org; [EMAIL PROTECTED] Subject: Re: [R] help with my sloppy syntax On Thu, 14 Aug 2008, Charles Annis, P.E. wrote: Thank you Professor Ripley: From your response it is clear that I left out something important, for which I apologize. Part of the et cetera is another list. Your method, which would work otherwise, also converts the other list to its members. The program being called has an argument list like (a, b, c, d, e, w, x, y, z) where z is a list but the other elements are single variables (not lists or vectors). Does using list(z) inside c() work? If I understand you correctly it will. I have the values of (a, b, c, d, e) returned from the R function optim as results$par. I wish to call my function with those values, some others, and finally with that other list, z. Is there a way to do this without defining another variable var and listing its elements without the undesirable unlisting that terminal variable z? Thank you. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley Sent: Thursday, August 14, 2008 11:20 AM To: Charles Annis, P.E. Cc: r-help@r-project.org; [EMAIL PROTECTED] Subject: Re: [R] help with my sloppy syntax Try c(as.list(par), a.hat.decision, et cetera ...) We are guessing what any of these are, of course. On Thu, 14 Aug 2008, Charles Annis, P.E. wrote: R-ians: After some effort I coerced my code to do what I want but my syntax is a kludge. Suggestions on more elegant syntax? par - NIM.results$par do.call(Draw.NIM.POD.curve, list(par[1], par[2], par[3], par[4], par[5], a.hat.decision, et cetera ... It seems that I should be able to avoid defining the variable par and then specifying each of its elements, but all my attempts resulted in a list whose first element is a list, rather than the elements of the list. And my attempts at unlist were unsuccessful. Thank you. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595
Re: [R] REvolution computing
Hi, Greg: Have you answered Uwe's question? I visited your website, and your idea sounds interesting. I'm an engineer, not a lawyer, but it seems to me that what you have IS in accord with the GPL - provided that that you make the R source available as Uwe asks. So: what's the answer to Uwe's question? Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Uwe Ligges Sent: Friday, July 18, 2008 7:28 AM To: Gregory R. Warnes Cc: r-help@r-project.org; Mariana Carla Gambarotta Subject: Re: [R] REvolution computing Gregory R. Warnes wrote: Hi All, Random Technologies LLCs commercially supported Rstat, based on R 2.7.2, is available today. For product information, visit http://www.random -technologies-llc. Hi Greg, two short questions on your very interesting product: 1. How can it be based on R-2.7.2? That R release has not been noticed any CRAN maintainer so far, as far as I know... 2. Where can I get the sources from? If it is based on the GPL'ed R, I guess I'll find the sources somewhere on your server. Best wishes, Uwe -Greg Gregory R. Warnes, Ph.D. Chief Scientist Random Technologies LLC email:[EMAIL PROTECTED] tel: (585) 419-6853 fax: (585) 672-5085 On 7/17/08 1:40PM , Mariana Carla Gambarotta [EMAIL PROTECTED] wrote: Hi, everybody. Sorry to bring up the subject again but I have visited the revolution computing web page, but its not clear when or what will be the new release be. Does anybody have information about that?. Does anybody know if the version that will be released will be validated?. I have been reading the previous mails about validation and I work in a Pharma company and validation is a big concern. Thank you Mariana _ Descargá GRATIS el poder del nuevo Internet Explorer 7. [[alternative HTML version deleted]] Gregory R. Warnes, Ph.D. Chief Scientist Random Technologies LLC email:[EMAIL PROTECTED] tel: (585) 419-6853 fax: (585) 672-5085 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] shapiro wilk normality test
http://www.bmj.com/cgi/content/full/311/7003/485 Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ted Harding Sent: Sunday, July 13, 2008 10:56 AM To: Frank E Harrell Jr Cc: r-help@r-project.org Subject: Re: [R] shapiro wilk normality test On 13-Jul-08 13:29:13, Frank E Harrell Jr wrote: [...] A large P-value means nothing more than needing more data. No conclusion is possible. Please read the classic paper Absence of Evidence is not Evidence for Absence. Is that ironic, Frank, or is there really a classic paper with that title? If so, I'd be pleased to have a reference to it! Thanks, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 13-Jul-08 Time: 15:55:35 -- XFMail -- __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Install Packages in Windows Vista
Run R as the Administrator. Install the packages. Then run as an ordinary user. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of nicholasw22 Sent: Tuesday, July 01, 2008 10:11 PM To: r-help@r-project.org Subject: [R] Install Packages in Windows Vista I can't seem to install packages to R. Each time I get the following output...for example bundle 'VR' successfully unpacked and MD5 sums checked The downloaded packages are in C:\Users\DarkBlue\AppData\Local\Temp\RtmpQrD7Le\downloaded_packages updating HTML package descriptions Warning message: In file.create(f.tg) : cannot create file 'C:\PROGRA~1\R\R/doc/html/packages.html', reason 'Permission denied' -- View this message in context: http://www.nabble.com/Install-Packages-in-Windows-Vista-tp18228954p18228954. html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] multiple multiplication in R
1*2*3*4*5*6 [1] 720 Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Manli Yan Sent: Wednesday, June 18, 2008 7:22 PM To: r-help@r-project.org Subject: [R] multiple multiplication in R hi: just a very simple quesion,how to do multiple multiplication in R x-c(1,2,3,4,5,6) how to get 1*2*3*4*5*6? I checked the Arithmetic Operators in R,but did not found the operators for this function,anyway can do this except the loop? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] rbinom not using probability of success right
Do it again. What did you get this time? Then do it another time. Do you see what is happening? Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philip Twumasi-Ankrah Sent: Wednesday, May 28, 2008 8:53 AM To: r-help@r-project.org Subject: [R] rbinom not using probability of success right I am trying to simulate a series of ones and zeros (1 or 0) and I am using rbinom but realizing that the number of successes expected is not accurate. Any advice out there. This is the example: N-500 status-rbinom(N, 1, prob = 0.15) count-sum(status) 15 percent of 500 should be 75 but what I obtain from the count variable is 77 that gives the probability of success to be 0.154. Not very good. Is there another way beyond using sample and rep together? A Smile costs Nothing But Rewards Everything Happiness is not perfected until it is shared -Jane Porter [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] rbinom : Does randomness preclude precision?
What do you mean by ... *eventual* nature of the distribution? If you simulated 100 samples, would you expect to see 1.5 successes? Or 1? Or 2? How many, in your thinking, is eventual? Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philip Twumasi-Ankrah Sent: Wednesday, May 28, 2008 9:52 AM To: [EMAIL PROTECTED] Cc: r-help@r-project.org Subject: Re: [R] rbinom : Does randomness preclude precision? Teds reply is a bit comforting and as indicated in my post, I am resorting to using sample but as an academic issue, does randomness preclude precision? Randomness should be in the sequence of zeros and ones and how they are simulated at each iteration of the process but not in the eventual nature of the distribution. I mean if I simulated a Normal (0, 1) and got a Normal(1.5, 2) these would be very different distributions. It is the same with simulating a Binomial(1, p=0.15) and getting Binomial(1, 0.154) [EMAIL PROTECTED] wrote: On 28-May-08 12:53:26, Philip Twumasi-Ankrah wrote: I am trying to simulate a series of ones and zeros (1 or 0) and I am using rbinom but realizing that the number of successes expected is not accurate. Any advice out there. This is the example: N-500 status-rbinom(N, 1, prob = 0.15) count-sum(status) 15 percent of 500 should be 75 but what I obtain from the count variable is 77 that gives the probability of success to be 0.154. Not very good. The difference (77 - 75 =2) is well within the likely sampling variation when 500 values are sampled independently with P(1)=0.15: The standard deviation of the resulting number of 1s is sqrt(500*0.15*0.85) = 7.98, so the difference of 2 is only 1/4 of a standard deviation, hence very likely to be equalled or exceeded. Your chance of getting exactly 75 by this method is quite small: dbinom(75,500,0.15) [1] 0.04990852 and your chance of being 2 or more off your target is 1 - sum(dbinom((74:76),500,0.15)) [1] 0.8510483 Is there another way beyond using sample and rep together? It looks as though you are seeking to obtain exactly 75 1s, randomly situated, the rest being 0s, so in effect you do need to do something on the lines of sample and rep. Hence, something like status - rep(0,500) status[sample((1:500),75,replace=FALSE)] - 1 Hoping this helps, Ted. E-Mail: (Ted Harding) Fax-to-email: +44 (0)870 094 0861 Date: 28-May-08 Time: 14:19:24 -- XFMail -- A Smile costs Nothing But Rewards Everything Happiness is not perfected until it is shared -Jane Porter [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] rbinom : Does randomness preclude precision?
I think I see the rub: You would like to see the distribution of a sample be identical to the distribution from which it was sampled. But if it is random then that can happen only in the long run, not on every sample. That is why samples from a normal density are *not* themselves normal - they're t. When the sample size is large enough the differences between a random sample's density and its parent density become vanishingly small. Thus the differences you observe from repeated random samples from the binomial. Repeated sampling produces slightly different numbers of successes. How could it be otherwise? Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com From: Philip Twumasi-Ankrah [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2008 10:36 AM To: [EMAIL PROTECTED] Subject: RE: [R] rbinom : Does randomness preclude precision? Charles, When you simulate data from a distribution, what you effect are doing is generating a sequence of values that would correspond to that distribution. So you can generate 1000 values from a normal distribution and expect that when you check on the distribution of your sample (what you do with your qqnorm or Q-Q plot), it should be a close fit with the theoretical distribution with the assigned parameter values. It will be difficult to explain why a simulated data may be different from the distribution it is was generated from . I think you can not blame it on randomness. I hope you understand what I am trying to determine. Charles Annis, P.E. [EMAIL PROTECTED] wrote: What do you mean by ... *eventual* nature of the distribution? If you simulated 100 samples, would you expect to see 1.5 successes? Or 1? Or 2? How many, in your thinking, is eventual? Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philip Twumasi-Ankrah Sent: Wednesday, May 28, 2008 9:52 AM To: [EMAIL PROTECTED] Cc: r-help@r-project.org Subject: Re: [R] rbinom : Does randomness preclude precision? Teds reply is a bit comforting and as indicated in my post, I am resorting to using sample but as an academic issue, does randomness preclude precision? Randomness should be in the sequence of zeros and ones and how they are simulated at each iteration of the process but not in the eventual nature of the distribution. I mean if I simulated a Normal (0, 1) and got a Normal(1.5, 2) these would be very different distributions. It is the same with simulating a Binomial(1, p=0.15) and getting Binomial(1, 0.154) [EMAIL PROTECTED] wrote: On 28-May-08 12:53:26, Philip Twumasi-Ankrah wrote: I am trying to simulate a series of ones and zeros (1 or 0) and I am using rbinom but realizing that the number of successes expected is not accurate. Any advice out there. This is the example: N-500 status-rbinom(N, 1, prob = 0.15) count-sum(status) 15 percent of 500 should be 75 but what I obtain from the count variable is 77 that gives the probability of success to be 0.154. Not very good. The difference (77 - 75 =2) is well within the likely sampling variation when 500 values are sampled independently with P(1)=0.15: The standard deviation of the resulting number of 1s is sqrt(500*0.15*0.85) = 7.98, so the difference of 2 is only 1/4 of a standard deviation, hence very likely to be equalled or exceeded. Your chance of getting exactly 75 by this method is quite small: dbinom(75,500,0.15) [1] 0.04990852 and your chance of being 2 or more off your target is 1 - sum(dbinom((74:76),500,0.15)) [1] 0.8510483 Is there another way beyond using sample and rep together? It looks as though you are seeking to obtain exactly 75 1s, randomly situated, the rest being 0s, so in effect you do need to do something on the lines of sample and rep. Hence, something like status - rep(0,500) status[sample((1:500),75,replace=FALSE)] - 1 Hoping this helps, Ted. E-Mail: (Ted Harding) Fax-to-email: +44 (0)870 094 0861 Date: 28-May-08 Time: 14:19:24 -- XFMail -- A Smile costs Nothing But Rewards Everything Happiness is not perfected until it is shared -Jane Porter [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. A Smile costs Nothing But Rewards Everything Happiness is not perfected until it is shared -Jane Porter __ R-help@r-project.org mailing
Re: [R] Pros and Cons of R
What do you mean, there are no up-grades? There are 1,401 ancillary packages - all free. That sounds like upgrades to me. Of course there is no *perfect* beginner's book, but Peter Dalgaard's Introductory Statistics with R (Paperback), Springer, 3d printing edition (January 9, 2004) is pretty close. If you don't know much statistics, it will teach you statistics while teaching you R. If you already know statistics, it will demonstrate how to do familiar things using R. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Monica Pisica Sent: Thursday, May 22, 2008 12:00 PM To: r-help@r-project.org Subject: [R] Pros and Cons of R Hi, I am doing a very informal presentation for my office about R capabilities to deal with and analyze spatial data, display data and maps, and connections with GIS. I've used in my presentation info from the CRAN, the spatial Task view, and the more striking graphics examples from http://addictedtor.free.fr/graphiques/thumbs.php and NCEAS http://www.nceas.ucsb.edu/scicomp/GISSeminar/UseCases/MapProdWithRGraphics/O neMapProdWithRGraphics.html together with examples of my own work. I am finishing with pros and cons about R and I am wondering if you can come up with other examples, or comments. Here they are: Pros: - R is a programming environment well suited for statistical analysis. - R is open source and cross platforms (Windows, Mac, Linux). - Fortran, C (C++), and Python wrappers are in place. - Deals well with spatial data, has a robust graphical interface and has an active user group list / forum. - External packages for R are almost daily increasing, most of them based on published up-to-date books and peer-reviewed articles. - R related books - quite a few .. Cons: - R has a very steep learning curve. - There is no perfect beginner book. - Experience with other programming languages is a plus / minus. - You can save scripts, but not *.exe. - It is updated several times a year (good) but there are no up-grades. - It seems that it is hard to install correctly under Linux. - Everything you want to do is a command line, minimal GUI. - Memory management problems (depends on your OS), especially when displaying big images at high resolution or working with huge matrices (hundreds of Mb). Also i am wondering if R works under 64 bit computers and if it takes advantage of it. Thanks, Monica _ Refresh_family_safety_052008 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Where to download BRugs
Could you mean RBugs? Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of qqw Sent: Thursday, May 22, 2008 3:10 PM To: r-help@r-project.org Subject: [R] Where to download BRugs Hi all, I tried to follow an online tutorial to run openBUgs but the package BRugs has been removed from R repository. Could someone provide a link for where to download BRugs? Thanks a lot! -- View this message in context: http://www.nabble.com/Where-to-download-BRugs-tp17411410p17411410.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How do you test for consecutivity?
This will work: my.list - c(2, 28, 31, 4, 27) sort(my.list) diff(sort(my.list)) any(diff(sort(my.list)) == 1) the middle two lines are only to illustrate what's going on. Best wishes! Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony28 Sent: Tuesday, April 29, 2008 8:52 AM To: r-help@r-project.org Subject: [R] How do you test for consecutivity? I need to use R to model a large number of experiments (say, 1000). Each experiment involves the random selection of 5 numbers (without replacement) from a pool of numbers ranging between 1 and 30. What I need to know is what *proportion* of those experiments contains two or more numbers that are consecutive. So, for instance, an experiment that yielded the numbers 2, 28, 31, 4, 27 would be considered a consecutive = true experiment since 28 and 27 are two consecutive numbers, even though they are not side-by-side. I am quite new to R, so really am puzzled as to how to go about this. I've tried sorting each experiment, and then subtracting adjacent pairs of numbers to see if the difference is plus or minus 1. I'm also unsure about whether to use an array to store all the data first. Any assistance would be much appreciated. -- View this message in context: http://www.nabble.com/How-do-you-test-for-%22consecutivity%22--tp16959748p16 959748.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to use the optim function if the length of the objectivefunction is greater than 1?
Help you out with what? You have not provided a commented, minimal, self-contained, reproducible example as you were asked to provide in the bottom text of every note to r-help. Can you expect help with a problem only you know? I *suspect* that you will need to define an objective function, such as the sum of the squares of deviations, so that the function is then single-valued. But that's only a guess, based on insufficient information. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of kakul modani Sent: Saturday, April 26, 2008 10:40 AM To: r-help@r-project.org Subject: [R] How to use the optim function if the length of the objectivefunction is greater than 1? Hi, Please help me out with this.Im a new user of R. Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Labelling a secondary axis in R
If you just want the title, look at ?mtext. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, April 21, 2008 10:23 AM To: Duncan Murdoch Cc: r-help@r-project.org Subject: Re: [R] Labelling a secondary axis in R Apologies for the private mail, Nabble has not yet updated the thread so I can write another post in it. I think I have confused things. I don't mean the labels are incorrect. They are fine. What I am referring to is a title for the secondary axis, which is currently entitled as c(-100,200). Obviously this isn't very useful. I will put some reproducible code on the post when it updates. Thanks, Rob On Apr 21 2008, Duncan Murdoch wrote: On 4/21/2008 9:02 AM, Nakamura wrote: Hello, How can I label a secondary axis in R? At the moment it's labelled as c(-100,200). Obviously I would like it to be more sensible. Here is the code I am using newx = -100+37.5*((1:9)-1) axis(4,at=newx,labels=(newx+100)/3750) I don't understand your question. When I run this code: newx = -100+37.5*((1:9)-1) plot(1:9, newx) axis(4,at=newx,labels=(newx+100)/3750) I get labels on side 4 which are 0, 0.01, ..., 0.08. I think we need a complete example to see the problem. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Huber-white cluster s.e. after optim?
I concur! Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rolf Turner Sent: Wednesday, April 09, 2008 10:22 PM To: R-help List Subject: Re: [R] Huber-white cluster s.e. after optim? On 10/04/2008, at 2:02 PM, [EMAIL PROTECTED] wrote: In many cases a) often looks difficult, but on closer inspection turns out to be impossible I nominate this for a fortune. cheers, Rolf Turner ## Attention:\ This e-mail message is privileged and confid...{{dropped:9}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] help with R semantics
Greetings: I'm running R2.6.2 on a WinXP DELL box with 2 gig RAM. I have created a new glm link function to be used with family = binomial. The function works (although any suggested improvements would be welcome), logit.FC - function(POD.floor = 0, POD.ceiling =1) { if (POD.floor 0 | POD.floor 1) stop (POD.floor must be between zero and one.) if (POD.ceiling 0 | POD.ceiling 1) stop (POD.ceiling must be between zero and one.) if (POD.ceiling - POD.floor difference.criterion) stop (paste(POD.ceiling-POD.floor difference must be greater than ,difference.criterion, to discourage answer-shopping., sep=)) linkfun - function(mu) { mu - qlogis( (mu - POD.floor)/(POD.ceiling - POD.floor) ) } linkinv - function(eta) { eta - POD.floor + (POD.ceiling - POD.floor)*plogis(eta) } mu.eta - function(eta) { (POD.ceiling - POD.floor)*dlogis(eta)# derivitaive of mu with respect to eta } valideta - function(eta) TRUE link - paste(logit.FC(, POD.floor, ,, POD.ceiling, ), sep = ) structure(list(linkfun = linkfun, linkinv = linkinv, mu.eta = mu.eta, valideta = valideta, name = link), class = link-glm) } as is evidenced by the call, binomial(logit.FC(0,1)) My semantics problem is that I have the name logit.FC(0,1), constructed elsewhere using paste(), and I need to remove the quotations in order to use it, since binomial(logit.FC(0,1)) will fail. I know I am missing something obvious and would appreciate any help. Thanks. Charles Annis, P.E. mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] NEW: Sociolects in R
Groovy!!! Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard Sent: Tuesday, April 01, 2008 10:19 AM To: R help Subject: [R] NEW: Sociolects in R The R translation teams have done a great job in making R usable for people who do not have English as their mother tongue. However, even within English speaking countries, there are groups which have trouble with the language, and it may be valuable to support the Sociolects of these groups too. Thanks to a generous contribution from Lars Polifo, these features will be made available in an upcoming version of R. As it turns out, there are some particularly interesting challenges that needs to be addressed. Consider for instance the translation of the t test in the locale en_SF_US.UTF8 (notice the interjection of the code SF to denote San Fernando Valley) t.test(extra ~ group, oh, baby, data = sleep) Welch Two Sample t-test data: extra by group t = -1.8608, like, df = 17.776, like, wow, p-value = 0.0794 alternative hypothesis: true difference in means is like, ya know, not equal to 0 95 percent confidence interval: -3.3654832 0.2054832 sample estimates: mean in group 1 mean in group 2 0.752.33 Notice that in addition to the simple message string modifications, it has been necessary to modify the parser so as to delete obviously superfluous arguments such as oh or baby (a particular issue here is that the argument like might actually be intended to mean likelihood). Similarly, for se_KC_SE.UTF8 (KC for kitchen) we have alternate spellings of arguments like data: t.test(ixtra ~ gruoop, deta = sleep) Velch Tvu Semple-a t-test deta: ixtra by gruoop t = -1.8608, dff = 17.776, p-felooe-a = 0.0794 elterneteefe-a hypuzeesees: trooe-a deeerence-a in meuns is nut iqooel tu 0 95 percent cunffeedence-a interfel: -3.3654832 0.2054832 semple-a isteemetes: meun in gruoop 1 meun in gruoop 2 0.752.33 Canadian English poses particular problems, which have not yet been resolved. If we are to do it properly, it would entail modifications to the R language itself. For instance we'd have to introduce a four loop and change the end-brace to the four-character string eh?}. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] invalid \uxxxx sequence while trying to create a package
Thank you, Professor Ripley! LazyLoad:FALSE in my DESCRIPTION file was the charm! (It took a bit of looking to determine the correct syntax. A search for lazyloading in Writing R Extensions was a red herring, but a search on CRAN suggesting lazy loading - obvious in hindsight, of course - sent me back to Writing ... and the correct syntax.) Thank you very much for the rescue. (I will revisit lazy loading when R-2.7.0 arrives.) Again, my sincere gratitude! Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley Sent: Saturday, March 22, 2008 3:50 AM To: Duncan Murdoch Cc: r-help@r-project.org; [EMAIL PROTECTED] Subject: Re: [R] invalid \u sequence while trying to create a package Now, I wonder who Duncan meant by 'one person on the list who can diagnose the problem' ? Hint: small packages are not selected for lazyloading, so do your example with lazy loading set in the DESCRIPTION file. If I do that, the example runs in R-devel but not in 2.6.2. It is a locale issue: the C locale is used where that sequence is not valid. (This is necessary: it is not valid in Japanese either and the run-time locale need not be the same as the install-time locale -- fortunately for the distribution of binary packages.) I would suggest that you do not use \u sequences on Windows until 2.7.0. Here \xe2 will work equally well, or if you want to be as portable as possible iconv(\xe2, latin1, ). Or turn lazyloading off and rely on run-time parsing. On Fri, 21 Mar 2008, Duncan Murdoch wrote: On 21/03/2008 6:01 PM, Charles Annis, P.E. wrote: I'm running R2.6.2 on a DELL box with 2gig RAM, using Rtools (v26). I have a perplexing problem trying to build a package. I've created a small demonstration: problem.demo - function () {cat(\n *** \u00e2 vs a***\n)} This function runs in an R gui session and Rtools makes a simple package containing it alone or with a handful of similar routines. However, when I include it with a much bigger package (that Rtools has no trouble in packaging without it), the result is an invalid \u sequence: Compile time: 0 minutes, 3 seconds 171 Topics 342 Local links 171 Internet links 1 Graphic Created c:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\Rbuild406495938\mh1823\chm\mh1823.chm, 149,803 bytes Compression decreased file by 398,668 bytes. preparing package mh1823 for lazy loading Loading required package: rcom Loading required package: RODBC Loading required package: RColorBrewer Loading required package: survival Loading required package: splines Error in parse(n = -1, file = file) : invalid \u sequence Calls: Anonymous - code2LazyLoadDB - sys.source - parse Execution halted make: *** [lazyload] Error 1 *** Installation of mh1823 failed *** Removing 'C:/DOCUME~1/CHARLE~1/LOCALS~1/Temp/Rinst406445831/mh1823' Clearly I am overlooking something obvious, so I would greatly appreciate any guidance. The general rules apply. Make it reproducible. You've done that for yourself, but you haven't given instructions that let anyone else reproduce it. If you simplify your example to a minimal one that reproduces the error, there's a good chance you'll spot what is wrong: but if not, there's a good chance someone else will be able to. If you post error messages without the code that causes them, there might be one person on the list who can diagnose the problem, but he's awfully busy. Post complete instructions for reproducing it. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] invalid \uxxxx sequence while trying to create a package
I'm running R2.6.2 on a DELL box with 2gig RAM, using Rtools (v26). I have a perplexing problem trying to build a package. I've created a small demonstration: problem.demo - function () {cat(\n *** \u00e2 vs a***\n)} This function runs in an R gui session and Rtools makes a simple package containing it alone or with a handful of similar routines. However, when I include it with a much bigger package (that Rtools has no trouble in packaging without it), the result is an invalid \u sequence: Compile time: 0 minutes, 3 seconds 171 Topics 342 Local links 171 Internet links 1 Graphic Created c:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\Rbuild406495938\mh1823\chm\mh1823.chm, 149,803 bytes Compression decreased file by 398,668 bytes. preparing package mh1823 for lazy loading Loading required package: rcom Loading required package: RODBC Loading required package: RColorBrewer Loading required package: survival Loading required package: splines Error in parse(n = -1, file = file) : invalid \u sequence Calls: Anonymous - code2LazyLoadDB - sys.source - parse Execution halted make: *** [lazyload] Error 1 *** Installation of mh1823 failed *** Removing 'C:/DOCUME~1/CHARLE~1/LOCALS~1/Temp/Rinst406445831/mh1823' Clearly I am overlooking something obvious, so I would greatly appreciate any guidance. Thanks. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] invalid \uxxxx sequence while trying to create a package
Greetings, R-Helpers: I am trying to build a package on WinXP, something that I have done before, but infrequently, and have recently updated both the Rtools and the version of R being used. My test case fails after successfully creating the compiled html files with this error message: . . . Created c:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\Rbuild142865646\March18\chm\March18.chm, 41,494 bytes Compression decreased file by 50,957 bytes. preparing package March18 for lazy loading Loading required package: rcom Loading required package: RODBC Loading required package: RColorBrewer Loading required package: survival Loading required package: splines Error in parse(n = -1, file = file) : invalid \u sequence Calls: Anonymous - code2LazyLoadDB - sys.source - parse Execution halted make: *** [lazyload] Error 1 *** Installation of March18 failed *** Removing 'C:/DOCUME~1/CHARLE~1/LOCALS~1/Temp/Rinst142800030/March18' While I can clearly read that the problem is invalid \u sequence I don't know what it means nor how to remedy it. Helpful suggestions would be greatly appreciated. Thanks. Charles Annis, P.E. mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] invalid \uxxxx sequence while trying to create a package
Thank you Duncan: I found the culprit - my menu contains lines like this one: winMenuAdd(menuname = mh1823/\u00e2 vs a/2. Build \u00e2 vs a Linear Model) This does produce a menu item that looks like â vs a and since R doesn't seem to like the a-hat character I tried to get around the objection with the corresponding Unicode character(s), obviously with no success. The menu works perfectly well, but can't be packaged as it currently is using R CMD build --binary March18. Is there no way for me to package the menu? Thanks, again. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Duncan Murdoch Sent: Tuesday, March 18, 2008 6:08 PM To: [EMAIL PROTECTED] Cc: r-help@r-project.org Subject: Re: [R] invalid \u sequence while trying to create a package On 18/03/2008 5:17 PM, Charles Annis, P.E. wrote: Greetings, R-Helpers: I am trying to build a package on WinXP, something that I have done before, but infrequently, and have recently updated both the Rtools and the version of R being used. My test case fails after successfully creating the compiled html files with this error message: . . . Created c:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\Rbuild142865646\March18\chm\March18.chm, 41,494 bytes Compression decreased file by 50,957 bytes. preparing package March18 for lazy loading Loading required package: rcom Loading required package: RODBC Loading required package: RColorBrewer Loading required package: survival Loading required package: splines Error in parse(n = -1, file = file) : invalid \u sequence Calls: Anonymous - code2LazyLoadDB - sys.source - parse Execution halted make: *** [lazyload] Error 1 *** Installation of March18 failed *** Removing 'C:/DOCUME~1/CHARLE~1/LOCALS~1/Temp/Rinst142800030/March18' While I can clearly read that the problem is invalid \u sequence I don't know what it means nor how to remedy it. Helpful suggestions would be greatly appreciated. The \u sequences are Unicode characters. The are supposed to be hexadecimal digits. So you might have something like cat(\u00B7) to display a dot. Invalid means it's not recognized, or not well-formed. So what I'd suggest is to search your source code for \u, and see if you inadvertantly included this for some other purpose. Alternatively, it's possible something has translated a non-Ascii character into a \u sequence; I don't know what might have done that. If none of that works, you could try reporting on what versions of everything you're using. You didn't mention that yet. And if they are all currrent versions (R 2.6.2, Rtools 2.7) then I guess you'll just have to divide and conquer: cut out half the source code and see if you still get the error. If so, cut it again, if not, look in the other half. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] GDD and dashed lines (lty=2)
Greetings, R Aficionados: I'm running R2.6.2 on a DELL WinXP box with 2 Gig RAM. My package GDD renderings of dashed lines aren't dashed. abline() will produce a dashed line, but lines() won't. Here is some illustrative code: library(GDD) GDD(dashed line, type=gif, width=480, height=480) par(mar = c(4.5, 5, 2.5, 1) + 0.1) plot(x=1:10, y=1:10, pch=16, las=1) abline(a=0, b=1, lty=2) lines(x=seq(1,10, length=2), y=1+seq(1,10, length=2), col=red, lty=2) dev.off() I experimented with the lines() length parameter thinking that perhaps having too many line segments was the problem, but even with length=2 the lines are not dashed. Any suggestions? Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Help needed in R
I believe I wrote too hastily and that what you want is sum(X 1) which will sum the indicator (T/F) function. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of AbouEl-Makarim Aboueissa Sent: Monday, March 03, 2008 11:55 AM To: Henrique Dallazuanna Cc: r-help@r-project.org; S Ellison Subject: Re: [R] Help needed in R Dear ALL: Please see below. I hope this will make it more clear. [1,]11 [2,]11 number of all observations less than 1 with indicator 1 (including those 1 with indicator 1 but not 1 with indicator 0)=2 [3,]10 [4,]10 [5,]10 [6,]10 [7,]10 [8,]10 [9,]10 [10,]21 [11,]21number of all observations less than 2 with indicator 1 (including those 2 with indicator 1 but not 2 with indicator 0)=11 [12,]20 [13,]20 [14,]20 [15,]20 [16,]30 [17,]30 [18,]30 [19,]30 [20,]30 [21,]30 [22,]30 [23,]30 [24,]40 [25,]40 [26,]40 [27,]40 [28,]40 [29,]51 [30,]51 [31,]51 [32,]51 [33,]51 number of all observations less than 5 with indicator 1 (including those 5 with indicator 1 but not 5 with indicator 0)=33 [34,]50 [35,]60 [36,]60 [37,]80 [38,]90 [39,]90 [40,] 101 [41,] 101 [42,] 101 [43,] 101 number of all observations less than 10 with indicator 1 (including those 10 with indicator 1 but not 10 with indicator 0)=43 [44,] 120 [45,] 140 [46,] 151 number of all observations less than 15 with indicator 1 (including those 15 with indicator 1 but not 15 with indicator 0)=46 [47,] 150 [48,] 170 [49,] 230 How I can write an R code to do this. Thanks Abou == AbouEl-Makarim Aboueissa, Ph.D. Assistant Professor of Statistics Department of Mathematics Statistics University of Southern Maine 96 Falmouth Street P.O. Box 9300 Portland, ME 04104-9300 Tel: (207) 228-8389 Fax: (207) 780-5607 Email: [EMAIL PROTECTED] [EMAIL PROTECTED] Office: 301C Payson Smith Henrique Dallazuanna [EMAIL PROTECTED] 3/3/2008 11:38 AM For me is not very clear, but if I understand: sapply(sort(unique(data[data[,2]==1,1])), function(x)sum(data[data[,2]==1 data[,1] = x, 1])) But the output is: 2 6 31 71 86 On 03/03/2008, AbouEl-Makarim Aboueissa [EMAIL PROTECTED] wrote: Dear Ellison: it did not do it. I edited my previous email to make my question more clear. The out put should be: (2,11,33,43,46) For example: number of all observations less than 1 with indicator 1 (including those 1 with indicator 1 but not 1 with indicator 0) =2 number of all observations less than 2 with indicator 1 (including those 2 with indicator 1 but not 2 with indicator 0) =11 number of all observations less than 5 with indicator 1 (including those 5 with indicator 1 but not 5 with indicator 0) =33 number of all observations less than 10 with indicator 1 (including those 10 with indicator 1 but not 10 with indicator 0) =43 number of all observations less than 15 with indicator 1 (including those 15 with indicator 1 but not 15 with indicator 0) =46 (1, 2,5,10,15) are the values in column one with indicator 1 in column two. which means I need to create a vector(2,11,33,43,46) for the data in column one. == AbouEl-Makarim Aboueissa, Ph.D. Assistant Professor of Statistics Department of Mathematics Statistics University of Southern Maine 96 Falmouth Street P.O. Box 9300 Portland, ME 04104-9300 Tel: (207) 228-8389 Fax: (207) 780-5607 Email: [EMAIL PROTECTED] [EMAIL PROTECTED] Office: 301C Payson Smith S Ellison [EMAIL PROTECTED] 3/3/2008 10:36 AM table(data[data[,2]==1,1]) AbouEl-Makarim Aboueissa [EMAIL PROTECTED] 03/03/2008 15:20:21 Dear ALL: How I can find the number of observations less than each value in column one with indicator 1 in column two. Please see the data below. For example: number of observations less than 1 with indicator 1 (including those 1 with indicator 1) =2 number of observations less than 2 with indicator 1 (including those 2 with indicator 1) =11 number of observations less than 5 with indicator 1 (including those 5 with indicator 1) =33 number of observations less than 10 with indicator 1 (including those 10 with indicator 1) =43 number of observations less than 15 with indicator 1 (including those 15 with indicator 1) =46 (1, 2,5,10,15) are the values in column one with indicator 1 in column two
Re: [R] Specify Path of an Excel file in R
One way that works for lazy people like me is to use file.choose(). 1) Type in file.choose() without the quotes and hit enter 2) Navigate to the folder and file that you want and click on it. 3) R will show you the complete path to your file. An even easier way is to do something like this: my.stuff - read.csv(file.choose(), ... and then navigate to your file. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of savanna3000 Sent: Sunday, February 17, 2008 10:53 AM To: r-help@r-project.org Subject: [R] Specify Path of an Excel file in R Hello Helpers, I have an Excel file on my desktop (.csv) which I want to use in my R worksheet, how can I specify the path while using read.csv() ? Savanna -- View this message in context: http://www.nabble.com/Specify-Path-of-an-Excel-file-in-R-tp15530586p15530586 .html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Formulae for R functions
Richard: Assuming that you have installed R and are not trying to find everything on the website, you can list the code of any function by just typing the function name and enter You will necessarily have to read the R code, but that is much easier than it may seem when you look at a couple pages of it, as you will when you list predict.lm Best wishes. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Saba Sent: Tuesday, February 12, 2008 8:36 AM To: r-help@r-project.org Subject: [R] Formulae for R functions Can someone direct me to a resource or resources that list the formulae used by R functions (i.e. predict.lm ) to calculate the statistic reported. I am not a programmer and studying the r code is extremely slow going. I have searched r-project.org and all the function help files without success. For example I have attempted to replicate by hand the se.fit calculation from a lm object calculated by a call to the predict function and have not been able to reproduce the results. Thanks, Richard Saba Department of Economics Auburn University Email: [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How many R packages?
1305 by my count. Go to CRAN and click on Packages. Then copy and paste the list into your text processor and look at the line count. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muenchen, Robert A (Bob) Sent: Tuesday, February 12, 2008 9:37 AM To: [EMAIL PROTECTED] Subject: [R] How many R packages? Hi All, I searched around to find the number of R packages currently available, but didn't find anything, so I choose all repositories told it to install. The list contained about 2,856 (correcting roughly for those installed). But the list includes repetitions such as 19 names that begin with bvbovine. Selecting only CRAN and CRAN(extras) I get 1,344. Is there an easier way to determine the total number of R packages available? Thanks, Bob = Bob Muenchen (pronounced Min'-chen), Manager Statistical Consulting Center U of TN Office of Information Technology 200 Stokely Management Center, Knoxville, TN 37996-0520 Voice: (865) 974-5230 FAX: (865) 974-4810 Email: [EMAIL PROTECTED] Web: http://oit.utk.edu/scc, News: http://listserv.utk.edu/archives/statnews.html = __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Off-topic - FORM/SORM
Greetings: FORM/SORM (First/Second Order Reliability Methods) are very popular among some structural engineers but almost never discussed among statisticians. I am quite predudiced as to the reasons for this, but would enquire among the world's statistical thinkers for their perspectives on these methods. Any comments, pro or con, would be greatly appreciated. Since this is off-topic, you may wish to reply directly to me and I will summarize the comments to the group. Thank you. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Which R version created a package?
Greetings, R-ians: I would like to know which version or R was used to create a given package. I think I remember seeing that topic discussed recently but cannot find it among my notes. Can anyone tell me how to determine which version of R created a package? Thanks. Charles Annis, P.E. mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Which R version created a package?
Many thanks to all. These methods all provide the needed info: library(help= lattice) packageDescription(lattice , fields=Built) packageDescription(lattice)$Built The first method produces nore complete information, should that also be interesting. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabor Csardi Sent: Saturday, January 26, 2008 12:05 PM To: Charles Annis, P.E. Cc: 'RHelp' Subject: Re: [R] Which R version created a package? library(help=lattice) [...] Built: R 2.6.0; i486-pc-linux-gnu; 2008-01-23 13:52:49; unix [...] G. On Sat, Jan 26, 2008 at 11:44:53AM -0500, Charles Annis, P.E. wrote: Greetings, R-ians: I would like to know which version or R was used to create a given package. I think I remember seeing that topic discussed recently but cannot find it among my notes. Can anyone tell me how to determine which version of R created a package? Thanks. Charles Annis, P.E. mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com http://www.StatisticalEngineering.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Csardi Gabor [EMAIL PROTECTED]UNIL DGM __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] glm expand model to more values
Jarek: Although it is not universally agreed on, I believe the first step in any data analysis is to PLOT YOUR DATA. dd - data.frame(a=c(1, 2, 3, 4, 5, 6), b=c(3, 5, 6, 7, 9, 10)) plot(b ~ a, data=dd) simple.model - lm(b~a,data=dd) abline(simple.model) Why to you think you need a cubic model to describe 6 observations? Your model is overparameterized - it has two more parameters than the number of observations can reasonably justify, something that would be obvious from your plot. The summary of the simple.linear model shows both the intercept and the slope are statistically meaningful. (That's what the asterisks mean.) Call: lm(formula = b ~ a, data = dd) Residuals: 123456 -0.23810 0.39048 0.01905 -0.35238 0.27619 -0.09524 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) 1.866670.30132 6.195 0.00345 ** a1.371430.07737 17.725 5.95e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.3237 on 4 degrees of freedom Multiple R-Squared: 0.9874, Adjusted R-squared: 0.9843 F-statistic: 314.2 on 1 and 4 DF, p-value: 5.952e-05 I think you should invest a small amount of your time, and an even smaller amount of your money to purchase and read - cover-to-cover - one of the several very good books on elementary statistics and R. My recommendation is _Introductory Statistics with R_ by Peter Dalgaard (Paperback - Jan 9, 2004). Amazon.com carries it. Best wishes. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jarek Jasiewicz Sent: Saturday, January 12, 2008 2:06 PM To: [EMAIL PROTECTED] Cc: R-help@r-project.org Subject: Re: [R] glm expand model to more values Charles Annis, P.E. wrote: How many parameters are you trying to estimate? How many observations do you have? What is wrong is that half of your parameter estimates are statistically meaningless: dd - data.frame(a=c(1, 2, 3, 4, 5, 6), b=c(3, 5, 6, 7, 9, 10)) overparameterized.model - glm(b~poly(a,3),data=dd) summary(overparameterized.model) Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) 6.6667 0.1725 38.644 0.000669 *** poly(a, 3)1 5.7371 0.4226 13.576 0.005382 ** poly(a, 3)2 -0.1091 0.4226 -0.258 0.820395 poly(a, 3)3 0.2236 0.4226 0.529 0.649562 Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jarek Jasiewicz Sent: Saturday, January 12, 2008 11:50 AM To: R-help@r-project.org Subject: [R] glm expand model to more values Hi I have the problem with fitting curve to data with lm and glm. When I use polynominal dependiency, fitted values from model are OK, but I cannot recive proper values when I use coefficents to caltulate this. Let me present simple example: I have simple data.frame: (dd) a: 1 2 3 4 5 6 b: 3 5 6 7 9 10 I try to fit it to model: model=glm(b~poly(a,3),data=dd) I have following data fitted to model (as I expected) fitted(model) 1 2 3 4 5 6 3.095238 4.738095 6.095238 7.33 8.619048 10.119048 and coef(model) (Intercept) poly(a, 3)1 poly(a, 3)2 poly(a, 3)3 6.667 5.7370973 -0.1091089 0.2236068 so when I try to expand the model to other data (simple extrapolation), let say: s=seq(1:10,by=1) I do: extra=sapply(s,function(x) coef(model) %*% x^(0:3)) and here is result: [1] 12.51826 19.49328 28.93336 42.18015 60.57528 85.46040 118.17714 [8] 160.06715 212.47207 276.73354 the data form expanding coefs are completly differnd from fitted What's going wrong? Jarek __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. sorry but I cannot understand. What does it means data are statistically meanningless? It is examle with very simple data which I use according to simpleR manual example to check why I cannot recive expected result. I need simple model y~x^3+x^2+z to extrapolate data Jarek __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting
Re: [R] how can i add a package that i want to use permanent
?.First This will explain things. You make a hidden program called .First like this .First - function() { library(lattice) } and then save your workspace. The next time you open R, lattice will load automatically. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ??? Sent: Wednesday, January 09, 2008 10:28 PM To: [EMAIL PROTECTED] Subject: [R] how can i add a package that i want to use permanent I want use a package(lattice) in R to do some work but everytime when i open R program ,this package is not loaded, so everytime i have to load it , who can tell me how to load this package permanent thanks!!! -- :zND2( TEL:15918732631 E-MAIL:[EMAIL PROTECTED] [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] installing and using a package
I'm not sure what you have done but using a package requires two steps: 1) installing or downloading the package, 2) loading an installed package. Since you are using windows you can click on Packages, Install packages, and after choosing a CRAN mirror, selecting the package you want. R will do the rest and tell you that it has installed the package (which it apparently has in your case). Now click on Packages again and choose Load package. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, January 10, 2008 7:07 PM To: r-help@r-project.org Subject: [R] installing and using a package i'm trying to learn R. i have no programing experience. i tried to add on a package and just picked yags. i can't get it to work or get any help. --- install.packages(yags) Warning in install.packages(yags) : argument 'lib' is missing: using 'C:\Documents and Settings\j\My Documents/R/win-library/2.6' trying URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.6/yags_4.0-2.zip' Content type 'application/zip' length 183779 bytes (179 Kb) opened URL downloaded 179 Kb package 'yags' successfully unpacked and MD5 sums checked The downloaded packages are in C:\Documents and Settings\j\Local Settings\Temp\RtmpXGE7rd\downloaded_packages updating HTML package descriptions --- then i tried: --- help(yags) No documentation for 'yags' in specified packages and libraries: you could try 'help.search(yags)' --- help.search doesn't help. when i type library() the result says: --- Packages in library 'C:\Documents and Settings\j\My Documents/R/win-library/2.6': yags Yet Another GEE Solver Packages in library 'C:/PROGRA~1/R/R-26~1.0/library': base The R Base Package boot Bootstrap R (S-Plus) Functions (Canty) class Functions for Classification cluster Cluster Analysis Extended Rousseeuw et al. ... --- i've checked the Admin and Maint manual, but i'm stumped as to how to get yags to actually work. i copied and pasted the example from the html file in the yags folder and after every line that called yags, there was an error message that said: Error: could not find function yags. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] non-ascii characters in TclTk
Thank you, Peter! The Unicode sequence \u00e2 for â is the ticket. While it is true that I can just use â in my TclTk code, when I use package.skeleton(name=unicode test), the R code changes my unacceptable â to e2 to indicate an error. My code will still run, of course, but doesn't display as expected (or does display as expected, depending on your expectations). ~:-) Your Unicode suggestion fixes all that. The package.skeleton() likes the escape sequence and the resulting TclTk widget displays the â as desired. Thank you! Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Sunday, December 30, 2007 5:10 AM To: [EMAIL PROTECTED] Cc: 'RHelp' Subject: Re: [R] non-ascii characters in TclTk Charles Annis, P.E. wrote: Greetings, R-Helpers: A year ago or so I was able to use the non-ascii character â in my TclTk. (You can type it on Windows as alt0226) I can use something like expression(hat(a)) elsewhere in R, but I seem to be doing something wrong when I try that syntax in TclTk. The widget will run but it displays something frightening like R-call_lang 019C8480 019A7724 where I expected to see â. Nothing frightening or unexpectable about that If you pass an expression, Tcl will think it is a callback. You shouldn't expect plotmath features to work outside of plots. Can anyone suggest how to use the a with caret in a TclTk widget? Can't you just type it in inside a string? Otherwise, Unicode escapes like \u00e2 should do it. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] non-ascii characters in TclTk
Greetings, R-Helpers: A year ago or so I was able to use the non-ascii character â in my TclTk. (You can type it on Windows as alt0226) I can use something like expression(hat(a)) elsewhere in R, but I seem to be doing something wrong when I try that syntax in TclTk. The widget will run but it displays something frightening like R-call_lang 019C8480 019A7724 where I expected to see â. Can anyone suggest how to use the a with caret in a TclTk widget? Thanks. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Running R from a CD on Windows?
Greetings, R-ians: Yes it's easy to run R from a CD: I copied my windows installation folder to the CD, then copied my R working directory to the CD. To run from the CD, I copy the working directory from the CD to the desktop, and then create an R desktop icon that points to Rgui.exe on the CD, and starts in the working directory folder I just copied to the desktop. The problem is that to create the desktop R icon you need to know that Rgui.exe is on the CD in the bin subfolder of the R-2.6.1 folder, which I know but the person being introduced to R for the first time does not. And creating a desktop icon is busywork that some find annoying. And then the user needs to copy the basic working directory folder to the desktop, since R needs to be able to write to it and writing to the CD can't work with a write-once CD. Alas, my uses just want to put the CD in the drive and have the autorun facility take care all this: 1) If there isn't a folder named R-project on the desktop, copy the one on the CD to the desktop. 2) Create a desktop icon for R that points to Rgui.exe on the CD. The installation must determine what drive is currently being accessed, since D:\R-2.6.1\bin\Rgui.exe would only work if the CD was running from drive D. 3) Have the icon Start in desktop\R-project which is legal if you create the icon yourself, but apparently not legal to put on the CD since the windows are erased and cannot be filled in if the icon is copied back from the CD to the desktop. Since the basic R installation on Windows can create a desktop icon, I know this must be possible. I would be grateful for any help. Thanks Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Drawing functions on Cartesian coordinate systems
Yes, R can do that. Well, actually YOU can do that using R. But it is hard to believe that you looked very hard before writing. Did you look at these R functions? ?plot ?line ?points ?arrows Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith Sent: Friday, September 28, 2007 1:12 PM To: r-help Subject: [R] Drawing functions on Cartesian coordinate systems Dear All, Can R draw plots of functions on a Cartesian coordinate system with axes like the ones shown at http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system-with-circle.s vg ? I have already searched the R web-site, but found nothing. Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.