Re: [R] Lattice + Word: Changing .wmf files to .pdf files

2008-06-05 Thread Mike Prager
quite workable, but not suitable for final version. If you want both Word and PDF versions to look good, there is no perfect solution. You could try generating the graphics as PNG, which will look good (but not great) in both places. That approach will likely increase file sizes considerably. Hope

[R] Bimodal Distribution

2008-05-29 Thread Mike Williams
exist, in which case could someone give me some other idea of how to accomplish this goal? Thanks, Mike __ 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/po

[R] Using unicode characters with paste or sprintf

2008-05-22 Thread Mike Toews
Hi, I'm having difficulties with Unicode characters with R 2.7.0 on Windows XP SP2. I'd like to use a delta character, which I'd also like to mix with other formatted output using paste() or sprintf(). On my system, I can successfully do this with a static string: print("\u0394Q = 2.2 L/s")

Re: [R] Nonlinear regression

2008-05-21 Thread Mike Prager
[EMAIL PROTECTED] wrote: > Could someone help me on the following: > SAS has DUD (Does not Use Derivatives) for nonlinear regression. > > Does "R" has a similar capability? > nls() -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represe

Re: [R] Identify groups

2008-05-17 Thread mike Ad.
)+1; data[5,1:40]=runif(40)+3; data[5,81:100]=runif(20)+5; data[9,1:20]=runif(20)+2; data[9,31:60]=runif(30)+4; data[9,71:90]=runif(20)+6; Many thanks! /Mike On Fri, May 16, 2008 at 4:52 PM, mike Ad. wrote: > Dear group, > > I have hundreds > of independent data sets, ea

[R] Identify groups

2008-05-16 Thread mike Ad.
d a statistics method to automatically pick out the data sets which have group pattern, or specifically found data sets have certain number of groups, e.g. 2, 3, 4. Are there any functions or packages that could solve this issue, or any other suggestions? Many Thanks! /M

[R] aggregate(), with multiple functions in FUN?

2008-05-16 Thread Mike !
I've got a data frame having numerical data by zip code: ZIP DATA 94111 12135.545 93105 321354.65654 94111 545.555 94706 558858.66 ... ... I'm using this function to group records by ZIP and calculate the median of DATA: aggregate(d$DATA, list(Zip = d$ZIP), F

Re: [R] Negative Binomial Model

2008-05-14 Thread Mike Ryckman
od to calculate the standard errors - and I'm not sure what that method is or how to do it in R. The gamlss package produces the closest results - but even those are still not exactly the same. Mike -Original Message- From: Ted Harding [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 14, 20

[R] Negative Binomial Model

2008-05-14 Thread Mike Ryckman
plain this and point me in the right direction? I'd really appreciate it. Thank you, Mike Ryckman Department of Political Science University of Arizona __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

[R] lme() with two random effects

2008-05-09 Thread Mike Lawrence
mpt yields the following error: library('nlme') lme( x ~ gender*con*int*tone*cue , random = ~ 1 | sub*age , data = a ) Error in getGroups.data.frame(dataMix, groups) : Invalid formula for groups I would be very grateful for any suggestions. Cheers, Mike -- Mike L

Re: [R] efficiency & profiling?

2008-05-02 Thread Mike Prager
s) ... :-) I used filters for a while. Now, I read the R list through the gmane Usenet interface. It appears to me to be a newsgroup, rather than a huge collection of emails. I find that much easier. See http://gmane.org/ -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal a

[R] Help with apply and split...

2008-05-02 Thread Mike H. Ryu
GVKEY NPERMNO GIC year 10001 12994 10001 55102010 2007 10002 19049 10002 40101015 2007 10009 16739 10009 40101010 1999 Has this been made into a proper data frame. How come the row numbers are not 1,2,3,4...? Thank you so much, and I would really appreciate any help!

Re: [R] Optimal knot locations for splines

2008-05-01 Thread Mike Dugas
Thanks for the help. I tried out the one promising lead, curfit.free.knot, and it doesn't work for linear or quadratic splines. The documentation says it should, but when I specify a linear spline, it returns a cubic. On 5/1/08, Spencer Graves <[EMAIL PROTECTED]> wrote: > > RSiteSearch('fr

[R] Optimal knot locations for splines

2008-05-01 Thread Mike Dugas
around the knot locations to minimize the loss function. Mike [[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

Re: [R] Bug? in summary( ) function base package

2008-04-30 Thread Mike Prager
s give the appearance of more precision than is really represented. -- 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.or

Re: [R] Running regression (lm, lrm) 100+ times and saving the results as matrix

2008-04-29 Thread Mike H. Ryu
(mydf, mydf$TIME), function(x){coefficients(summary(glm(X ~ A + B, data = x, family=binomial)))}) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike H. Ryu Sent: Tuesday, April 29, 2008 7:27 AM To: r-help@r-project.org Subject: [R] Running regression (lm

[R] Running regression (lm, lrm) 100+ times and saving the results as matrix

2008-04-29 Thread Mike H. Ryu
n the regression for each month, but I need to know how I would combine the regression results together into a matrix possibly. Thank you! Mike --- m = max(data$TIME) # define regmatrix for(i in 1:m){ g=runreg(data, i) # attach g to regmatrix } r

Re: [R] Use of recordPlot

2008-04-28 Thread Mike Prager
ll persist across script runs and even sessions. You may need to change the code to suit your own needs. Does that help? Mike > [...] > But the end of your response hits on the key issue: when I create > several graphs, I would like to be able to use PgUp/PgDn or some other > keyst

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

2008-04-24 Thread Mike Dugas
not use xs <- seq(min(x1), max(x1), length = 100) instead of xs <- with(m, seq(min(x1), max(x1), length = 100)) ? Second, what is the function geom_line()? I couldn't find it. Thanks, Mike On 4/23/08, hadley wickham <[EMAIL PROTECTED]> wrote: > > On Wed, Apr 23, 2008 at

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

2008-04-23 Thread Mike Dugas
The code I 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. Th

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 a

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

2008-04-23 Thread Mike Dugas
, 1112, 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

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

2008-04-23 Thread Mike Dugas
$x1))/ + min(m$x1),c(0:)*0-9) for(i in c(0:)) { a[2,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,

Re: [R] Writing list object to a file

2008-04-23 Thread Mike Prager
# cancel redirection options(width = tmp.wid) # restore linewidth return(invisible(NULL)) # return (nothing) from function } ## -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * An

Re: [R] graphics history

2008-04-21 Thread Mike Prager
ut this isn't urgent enough to have prodded me into writing > it before now. A finite size would be nice. I've been 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 th

[R] rgl snapshot

2008-04-19 Thread Mike Ryckman
Hello everyone, I know I can save a snapshot an rgl device, but currently it only appears to do png format. Is there some way of exporting a high-quality picture more fit for publication? Thanks, Mike __ R-help@r-project.org mailing list https

Re: [R] plot data with a colour scale

2008-04-15 Thread Mike Prager
require(lattice) ?levelplot -- 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/ma

Re: [R] Adding average into a matplot?

2008-04-10 Thread Mike Prager
all simulations. Can anyone 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 constitu

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

2008-04-09 Thread Mike Prager
asy to modify my example to fit your question. If you search the group archives, you should be able to find it. The thread title was "background color in scatterplots". MHP -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are perso

Re: [R] background color in scatterplots

2008-03-28 Thread Mike Prager
ngth(vrefs2), s = 0.15) # Add the colors to the plot: for (i in 2:length(vrefs2)){ polygon(c(vrefs2[(i-1):i], 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()

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
I'm afraid I'm not seeing it. I'd appreciate 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 Univ

Re: [R] numeric format

2008-02-27 Thread Mike Prager
to an R Core person that my version 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 r

Re: [R] Reading a file created with Fortran

2008-02-27 Thread Mike Prager
d serve two purposes: making read.table() work 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

[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 St

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

2007-12-27 Thread Mike Jones
;- i + 1 } else{ garbage <- garbage+1 } cat("i = ",i,"garbage = ",garbage,"\n") } -Original Message----- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Thursday, December 27, 2007 5:36 PM To: Mike Jones Cc: [EMAIL

[R] Conditionally incrementing a loop counter: Take 2

2007-12-27 Thread Mike Jones
7 initial i = 9 second i = 9 initial i = 10 second i = 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

[R] Conditionally incrementing a loop counter

2007-12-27 Thread Mike Jones
7;t seem to manually 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 R

Re: [R] Rating R Helpers

2007-12-03 Thread Mike Prager
essional use of LaTeX. At its root, this is a rather deep question: how open-source, largely volunteer-developed software can survive over the long term, while continuing to improve and maintain high standards. We are rather early in the history of free software development to know the answer.

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 Mik

Re: [R] R graph window

2007-11-27 Thread Mike Prager
t;- NULL # Deletes any existing plot history windows(record = TRUE, ...) 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

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

2007-11-26 Thread Mike Prager
viewed only a single package. I think 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 * Opini

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,

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

2007-11-21 Thread Mike Prager
tax (and other) help by Googling than to pull the reference 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] How to save multiple graphs into a single file

2007-11-16 Thread Mike Jones
can't want to use lattice, because I have hundreds of plots. So, to keep it simple, let's say I am plotting 3 series of boxplots like, boxplot(data1~groups,...) boxplot(data2~groups,...) boxplot(data3~groups,...) Is there a way to get these into a single pdf file? Thanks in advance...

Re: [R] Aggregate with non-scalar function

2007-11-07 Thread Mike Nielsen
Yes, that's exactly it! Many thanks, it all comes back to me now! It's the darn do.call that I can never remember somehow. I know I've reinvented this wheel several times -- you'd think I'd learn. Sigh. Again, my thanks! Regards, Mike On Nov 7, 2007 2:35 PM, jim

[R] Aggregate with non-scalar function

2007-11-07 Thread Mike Nielsen
t I mean"? My doit function gets more and more ugly the more summary statistics I add, and I worry about the "merge" with hundreds of thousands of rows. I'm almost sure I've seen a solution to what I know is a simple problem, but I guess my search skills are as bad as my &q

Re: [R] Help for Beginner!!

2007-10-29 Thread Mike Prager
re. I agree with the suggestions 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 traden

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 t

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 distri

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

[R] Tricky vectorization problem

2007-10-06 Thread Mike Lawrence
for B and grab the mean } 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.c

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

2007-10-01 Thread Mike Lawrence
-- > > Ravi Varadhan, Ph.D. > > Assistant Professor, The Center on Aging and Health > > Division of Geriatric Medicine and Gerontology > > Johns Hopkins University > > Ph: (410) 502-2619 > > Fax: (410) 614-9625 > > Email: [EMAIL PROTECTED] > > Webpage: htt

[R] optimize() stuck in local plateau ?

2007-09-30 Thread Mike Lawrence
iptions as above (I'm exploring a large 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 Unive

Re: [R] text formatting

2007-09-21 Thread Mike Prager
stephen bond <[EMAIL PROTECTED]> wrote: > Does R have any functions for C/Fortran style text formatting when a > number needs to be output right-justified in a fixed length field? > > say '%2d %3d %5.3f' ?formatC -- Mike Prager, NOAA, Beaufort, NC * Opinions ex

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

[R] Create correlated data with skew

2007-09-17 Thread Mike Lawrence
10,] -0.1937206 -0.564203311 > cor(a) [,1] [,2] [1,] 1.0 0.5 [2,] 0.5 1.0 But I'm looking to create data where the variables are non-normally distributed (i.e. somewhat skewed). Any suggestions? Mike -- Mike Lawrence Graduate Student, Department of Psychology, Dalhousie Un

<    4   5   6   7   8   9