Re: [R] Writing list object to a file

2008-04-23 Thread Mike Prager
} ## -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA endorsement. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] Can I get rid of this for loop using apply?

2008-04-23 Thread Mike Dugas
,i+1] - mean(predict(lm1,cbind(m[,-match(x1,names(m))],x1=a[1,i+1]))) } plot(a[1,],a[2,],xlab=x1,ylab=Response,type=l,main=Partial Dependence Plot) Many thanks, Mike [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Can I get rid of this for loop using apply?

2008-04-23 Thread Mike Dugas
, byrow=T) a[2,] - apply(b,2,FUN=function(x) {mean(predict(lm1,cbind(m[,-match(x1,names(m))],x1=x))) }) plot(a[1,],a[2,],xlab=x1,ylab=Response,type=l,main=Partial Dependence Plot) Mike Dugas [[alternative HTML version deleted]] __ R-help@r

Re: [R] Can I get rid of this for loop using apply?

2008-04-23 Thread Mike Dugas
Thanks for the help. That explains why my time testing showed no difference. Is there any way to speed up the program? It is unbearably slow if I increase the number of loops. Mike On Wed, Apr 23, 2008 at 6:23 PM, hadley wickham [EMAIL PROTECTED] wrote: On Wed, Apr 23, 2008 at 4:23 PM

Re: [R] Can I get rid of this for loop using apply?

2008-04-23 Thread Mike Dugas
wrote does this using predict() which is useful for modeling approaches like GAMs. Mike On Wed, Apr 23, 2008 at 8:47 PM, hadley wickham [EMAIL PROTECTED] wrote: On Wed, Apr 23, 2008 at 7:31 PM, Mike Dugas [EMAIL PROTECTED] wrote: Thanks for the help. That explains why my time testing showed

Re: [R] graphics history

2008-04-21 Thread Mike Prager
using this code in scripts: graphics.off() windows(record = TRUE) .SavedPlots - NULL Not exactly the same thing, but it limits memory use. Are there side effects that could bite me? -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use

Re: [R] plot data with a colour scale

2008-04-15 Thread Mike Prager
-- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA endorsement. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Adding average into a matplot?

2008-04-10 Thread Mike Prager
help me with this? Take a look at help pages of the following functions: mean, apply, abline. -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA endorsement

Re: [R] How to add background color of a 2D chart by quadrant

2008-04-09 Thread Mike Prager
to find it. The thread title was background color in scatterplots. MHP -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA endorsement. __ R-help@r

Re: [R] background color in scatterplots

2008-03-28 Thread Mike Prager
], vrefs2[i:(i-1)]), c(rep(pdims[3],2), rep(pdims[4],2)), col = cols[i], border = NA) } # Draw the reference lines, points, and box: abline(v = vrefs) points(a, b, lwd = 1.5) box() -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise

Re: [R] Extracting single output data into a vector or matrix

2008-03-27 Thread Mike Prager
Ayman, It is difficult to say without seeing some code, but your output seems to be not a list in the R sense but a collection of vectors, each of length 1. The best way to put the values into a vector probably is to assign them to the elements of the vector during your computations. Mike Prager

Re: [R] Constrained regression

2008-03-03 Thread Mike Cheung
models. Psychometrika, 49, 37-47. Regards, Mike -- - Mike W.L. Cheung Phone: (65) 6516-3702 Department of Psychology Fax: (65) 6773-1843 National University of Singapore http://courses.nus.edu.sg/course

[R] new to latex to pdf

2008-03-02 Thread Mike Babyak
if anyone could point me in the right direction. ( I have no trouble writing my own simple latex code and converting it to pdf using pdftex in miktex). Thanks, Mike Babyak Department of Psychiatry and Behavioral Science Duke University Medical Center ** Here's the code

Re: [R] Reading a file created with Fortran

2008-02-27 Thread Mike Prager
on the data set and making it easier for humans to check the data file more easily. Second, you could look at read.fortran() -- a function that takes a lightly modified Fortran format specification as an argument. That seems even better for your purposes than read.fwf. -- Mike Prager, NOAA, Beaufort

Re: [R] numeric format

2008-02-27 Thread Mike Prager
of print.data.frame() be adopted as the system version, but was politely declined. Rolf-- Clearly, and appropriately, R development is not a democratic process. Still, if a vote were held, I would support your version. I have also needed to suppress row names from time to time. -- Mike Prager, NOAA

[R] Font analysis?

2008-01-21 Thread Mike Lawrence
Hi all, My initial searches on this yielded bupkis; I'm looking to access the pixel-by-pixel data (preferably as a matrix, 0 for black, 1 for white) of rendered letters(given a specific font, size, and dpi. Any suggestions as to how to achieve this? Mike -- Mike Lawrence Graduate Student

[R] Conditionally incrementing a loop counter

2007-12-27 Thread Mike Jones
adjust i because from what I understand, R creates 100 long vector and uses that to loops thru and I'm not sure how to get at the index of that vector. Any suggestions? Thanks in advance. Mike Jones Westat 1650 Research Blvd. RE401 Rockville, MD 20850 Ph: 240.314.2312 [[alternative

[R] Conditionally incrementing a loop counter: Take 2

2007-12-27 Thread Mike Jones
= 10 -Original Message- From: Mike Jones Sent: Thursday, December 27, 2007 4:35 PM To: '[EMAIL PROTECTED]' Subject: Conditionally incrementing a loop counter Hi, I am trying a for loop from 1 to 10 by 1. However, if a condition does not get met, I want to throw

Re: [R] Conditionally incrementing a loop counter: Take 2

2007-12-27 Thread Mike Jones
,garbage = ,garbage,\n) } -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Thursday, December 27, 2007 5:36 PM To: Mike Jones Cc: [EMAIL PROTECTED] Subject: Re: [R] Conditionally incrementing a loop counter: Take 2 Mike Jones wrote: My apologies for not including

Re: [R] Rating R Helpers

2007-12-03 Thread Mike Prager
term, while continuing to improve and maintain high standards. We are rather early in the history of free software development to know the answer. -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA

Re: [R] [OT] putting URLs in Latex

2007-11-28 Thread Mike Prager
Edna Bell [EMAIL PROTECTED] wrote: Hi R Gurus! This is definitely off topic, but I thought I'd try: what is the way to put in url's into a Latex file, please? In future, you might want to post such questions in group comp.text.tex Mike -- Mike Prager, NOAA, Beaufort, NC * Opinions

Re: [R] R graph window

2007-11-27 Thread Mike Prager
, ...) You might also be interested in the savePlot function, well described in the R help files. -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA endorsement

Re: [R] writing summary() to a text file

2007-11-26 Thread Mike Prager
Federico Calboli [EMAIL PROTECTED] wrote: I would like to output the results of a function into a text file, legible as a such. The function produces a summary quite like: Take a look at the sink() function. Does that do what you need? -- Mike Prager, NOAA, Beaufort, NC * Opinions

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-26 Thread Mike Prager
basing reviews around a specific topic/methodology would be more useful than basing them around a single package. I agree: Such articles would be welcome resources if published either in JSS or in R-News. -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented

Re: [R] Packages - a great resource, but hard to find the right one.

2007-11-21 Thread Mike Prager
manual off the shelf or start up an online help file. -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA endorsement. __ R-help@r-project.org mailing

[R] Aggregate with non-scalar function

2007-11-07 Thread Mike Nielsen
as my R: I've rummaged around the r-help archives and came up with nothing to show for it. Pointers would be gratefully received. Many thanks. -- Regards, Mike Nielsen __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Help for Beginner!!

2007-10-29 Thread Mike Prager
made so far. Also, consider buying or borrowing a copy of Introductory Statistics with R by Peter Dalgaard. It is well written and brief. -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA

Re: [R] Tricky vectorization problem

2007-10-07 Thread Mike Lawrence
Had a realization this morning that I think achieves ceiling performance and thought I'd share with the list. I was previously generating sample data per participant and then calculating a mean, but of course this could be simplified by simply getting a single value from the sampling

Re: [R] Tricky vectorization problem

2007-10-07 Thread Mike Lawrence
Posting this for posterity and to demonstrate that a speed-up of 2 orders of magnitude is indeed possible! I can now run 1e5 monte carlo experiments in the time the old code could only run 1e3. The final change was to replace my use of cor() with .Internal(cor()), which avoids some checks

[R] Tricky vectorization problem

2007-10-06 Thread Mike Lawrence
} sim.r[i] = cor(a,b) #store the observed correlation between A and B } print(proc.time()[1]-start) #show the total time this took -- Mike Lawrence Graduate Student, Department of Psychology, Dalhousie University Website: http://memetic.ca Public calendar: http

Re: [R] Tricky vectorization problem

2007-10-06 Thread Mike Lawrence
Seems there were some line break issues when pasting the code, trying again with a different commenting style: #start a timer start = proc.time()[1] #set the true correllation rho = .5 #set the number of Subjects Ns = 100 #for each subject, set a number of observations in A a.No = 1:100 #for

Re: [R] optimize() stuck in local plateau ?

2007-10-01 Thread Mike Lawrence
-- -- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Mike Lawrence Sent: Monday, October 01, 2007 1:29 AM To: Rhelp Subject: [R] optimize() stuck in local plateau

[R] optimize() stuck in local plateau ?

2007-09-30 Thread Mike Lawrence
number of 'black boxes'). I do know that the maximum must occur between -1 and 1 for all however. Please advise on how I might use optimize more usefully. Mike -- Mike Lawrence Graduate Student, Department of Psychology, Dalhousie University Website: http://memetic.ca Public calendar: http

Re: [R] how to find p in binomial(n,p)

2007-09-19 Thread Mike Meredith
I think the function you need is 'help.search'; try: help.search(binomial) and look for something obvious in the 'stats' package. A good deal quicker and easier than posting to an internet forum! Cheers, Mike. cathelf wrote: Dear all, I am trying a find the value p in binomial. X

<    4   5   6   7   8   9