Re: [R] Question about making array dataset inside a package

2007-09-05 Thread Kuhn, Max
Please read http://cran.r-project.org/doc/manuals/R-exts.html especially Section 1.1.3. Use save to create an Rdata file. Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wallace Hui Sent: Wednesday, September 05, 2007 4:18 PM To:

Re: [R] Using odfWeave to Produce Tables with Right-aligned Cells

2007-08-24 Thread Kuhn, Max
Rick, First, please send the results of SessionInfo so I know exactly what versions you are using. Also, are you using OpenOffice? If so, what version? If you use the current version of odfWeave, there is a file with many details about formatting in the examples subdirectory. Here is what I

Re: [R] Using odfWeave to Produce Tables with Right-aligned Cells

2007-08-24 Thread Kuhn, Max
It appears to be an OpenOffice bug: http://www.openoffice.org/issues/show_bug.cgi?id=73163 Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kuhn, Max Sent: Friday, August 24, 2007 1:52 PM To: Rick Bilonick; R Help Subject: Re: [R] Using odfWeave

Re: [R] odfWeave processing error, file specific

2007-08-09 Thread Kuhn, Max
Aric, Can you send me a reproducible example (code and odt file) plus the results if sessionInfo()? Thanks, Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aric Gregson Sent: Thursday, August 09, 2007 6:56 PM To: r-help@stat.math.ethz.ch Subject:

Re: [R] regular expressions : extracting numbers

2007-07-30 Thread Kuhn, Max
This might work: numOnly - function(x) gsub([^0-9], , x) numOnly(lema, rb 2%) [1] 2 numOnly(rb) [1] Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of GOUACHE David Sent: Monday, July 30, 2007 7:59 AM To: r-help@stat.math.ethz.ch Subject: [R]

Re: [R] Large dataset + randomForest

2007-07-26 Thread Kuhn, Max
Florian, The first thing that you should change is how you call randomForest. Instead of specifying the model via a formula, use the randomForest(x, y) interface. When a formula is used, there is a terms object created so that a model matrix can be created for these and future observations. That

[R] odfWeave - How to Insert eps rather than png

2007-07-23 Thread Kuhn, Max
Rick, First, can you send details about your versions/OS using sessionInfo()? If you create plots and use odfWeave to create an odf text document, the default for figures is png bitmap graphics. The only way I've found to insert eps graphics is to first create the eps graphic using the

Re: [R] similar limma's contrasts.fit() for lme (mixed effect model)object

2007-07-09 Thread Kuhn, Max
Shirley, The contrast package can do this. The method of specifying the contrast conditions/coefficients is different (and I think easier). Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of shirley zhang Sent: Monday, July 09, 2007 11:16 AM To:

Re: [R] similar limma's contrasts.fit() for lme (mixed effect model)object

2007-07-09 Thread Kuhn, Max
, July 09, 2007 11:50 AM To: Kuhn, Max Cc: R-help@stat.math.ethz.ch Subject: Re: [R] similar limma's contrasts.fit() for lme (mixed effect model)object Hi Max, Thanks for your prompt reply. Actually I have already checked contrast package, but I still could not figure out how to set the contrast

Re: [R] eps in odfWeave

2007-06-25 Thread Kuhn, Max
Dieter, What is the version of odfWeave? If you use those specifications in the current version (0.5.9): plotInfo - getImageDefs() plotInfo$type = eps plotInfo$device = postscript setImageDefs(plotInfo) you will probabiliy need to set horizontal = FALSE, onefile = FALSE, and paper = special

Re: [R] Fitting a model to a test set

2007-06-24 Thread Kuhn, Max
Des, Please provide some information (like the results of sessionInfo) and example code for your model. Did you use gee to fit the model and with what function? If could be that you need to examine the type argument of the predict function to make sure that you are getting the scale that you are

Re: [R] Data consistency checks in functions

2007-06-22 Thread Kuhn, Max
Anup, There are two ways to pass arguments to functions in R: as named arguments or by position*. Users *can* supply arguments that are inconsistent with the order that you specify in the function definition, but only if they are used as named arguments: myfun(X = someMatrix, values =

[R] [R-pkgs] odfWeave version 0.5.9 released

2007-06-21 Thread Kuhn, Max
A new version of odfWeave has been released to CRAN. This is a significant change to the package internals. It now uses the XML library instead of a bunch of regular expressions. New features include: - Captions for tables and figures - Functions to insert page breaks and to change the

Re: [R] R vs. Splus in Pharma/Devices Industry

2007-06-15 Thread Kuhn, Max
Greg, I have looked at ooconvert, but unfortunately the current version is limited to *nix, and I am currently in a MS windows world. I tried getting it to run under cygwin at one point, but did not succeed at the time. Once it is available more generally, I will just set up Makefiles so

Re: [R] R vs. Splus in Pharma/Devices Industry

2007-06-14 Thread Kuhn, Max
Greg, Thanks for the kind words about odfWeave. These reports are usually put out as internal webpages for various people in the organization to look at, so we could either go the odfWeave approach and generate pdf files (not as automated as I would like) I agree that automating the

Re: [R] Neural Net. in R

2007-06-06 Thread Kuhn, Max
Jason, Your best bet is the nnet package. It is part of the VR bundle, which may be why you missed it. The code is well documented and the package is closely tied to two books (see the references in ?nnet). Also, it has a predict function, which many of the others do not. This isn't too big

Re: [R] multiple plot in odfWeave

2007-06-05 Thread Kuhn, Max
Laurence, I haven't seen any issues like this. Can you: 1. Send the results of sessionInfo() 2. Try using carte2, echo = FALSE, results= xml, fig = TRUE=. It sounds like the text being written to the xml file is not valid xml. This could be the case if results != xml. 3. If that doesn't

Re: [R] odfTable

2007-06-05 Thread Kuhn, Max
Sarah and Laurence, A few comments: 1. The default background color for columns is horrible. I've changed to white it in the upcoming version. 2. In the next version (in 1-2 weeks), I have a fairly long document that goes into much more detail about the specific styles that can be changed

Re: [R] naiveBayes other than e1071

2007-06-05 Thread Kuhn, Max
Message- From: Uwe Ligges [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 05, 2007 3:56 PM To: Saeed Abu Nimeh Cc: Kuhn, Max; r-help@stat.math.ethz.ch Subject: Re: [R] naiveBayes other than e1071 Saeed Abu Nimeh wrote: Max, Thanks. I have tried it but i keep getting an error: Error

Re: [R] naiveBayes other than e1071

2007-06-04 Thread Kuhn, Max
Saeed, There is a version in the klaR package. I recently submitted a change to the predict function that may be related to your problem. If: 1. the posterior probabilities (apart from the prior) are being approximated by the product of the p(x_i|y_j) and 2. a lot of predictors are being

Re: [R] sd with n not n-1

2007-05-31 Thread Kuhn, Max
Ted, This is pretty simple. If you are new to programming with R, please read the Introduction to R at http://cran.r-project.org/doc/manuals/R-intro.html This will answer most of the basic questions, but it requires more time than typing out an email. If you still have questions, please

Re: [R] Parallel processes

2007-05-22 Thread Kuhn, Max
Erin, There is a snow package (note the case) and also a few others. Rlsf, is specific to grids/clusters that use the LSF queue system. More generally, the nws package is more sophisticated and should work on most systems. Also, there is Rmpi (which I haven't used). Max -Original

Re: [R] Package contrast error

2007-05-03 Thread Kuhn, Max
Ken, lme.fnl.REML - lme(Max ~ S + Tr + Yr + Tr:Yr, random = ~1 |TID, method = REML) You have three variables in the model: S, Tr and Yr. tst - contrast(lme.fnl.REML, a=list(Yr=levels(Yr), Tr=R), b=list (Yr=levels(Yr, Tr=T97))) Error in gendata.default(fit = list(modelStruct =

Re: [R] Independent contrasts from lme with interactions

2007-05-01 Thread Kuhn, Max
Ken, Take a look at the just released contrast package. Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ken Nussear Sent: Monday, April 30, 2007 6:12 PM To: r-help@stat.math.ethz.ch Subject: [R] Independent contrasts from lme with interactions Hi

[R] [R-pkgs] New packages: contrast and desirability

2007-04-27 Thread Kuhn, Max
The contrast and desirability packages are available for all platforms at cran.r-project.org (and coming soon to a mirror near you). The contrast package extends Frank Harrell's contrast.Design function for one degree of freedom contrasts of model parameters to other types of models, such as lm,

Re: [R] Programming Problem (for loop, random # control, 3 dimentional graph)

2007-04-11 Thread Kuhn, Max
Wow. Some suggestions are below. 1. You should vectorize the for loop in the function g. I would do something like this: z1 - rnorm(20 * 100, 0, 1) Q1=0+1*z1*(1+.83*(1-exp(-G*z1))/(1+exp(-G*z1)))*(1+z1**2)**K Q1Matrix - matrix(Q1, ncol = 100) ksStat - function(x) ks.test(x, pnorm, mean =

Re: [R] Programming Problem (for loop, random # control, 3 dimentional graph)

2007-04-11 Thread Kuhn, Max
Sorry, there was a typo in this line: function(x) ks.test(x, pnorm, mean = mean(x), sd = sd(x))$p.value Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kuhn, Max Sent: Wednesday, April 11, 2007 9:55 AM To: [EMAIL PROTECTED]; r-help

Re: [R] Could not fit correct values in discriminant analysis by bruto.

2007-04-09 Thread Kuhn, Max
Shuji, I suspect that bruto blows up because your data are linearly separable. To see this (if you didn't already know), try library(lattice) splom(~x, groups = y) and look at the first row. If you are trying to do classification, there are a few methods that would choke on this (logistic

Re: [R] Could not fit correct values in discriminant analysis by bruto.

2007-04-09 Thread Kuhn, Max
approaches. Max -Original Message- From: ?? ?? [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 1:49 PM To: Kuhn, Max Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Could not fit correct values in discriminant analysis by bruto. Dear Max, Thank you very much ! Your sample code is very

Re: [R] Hardware for a new Workstation for best performance using R

2007-03-19 Thread Kuhn, Max
At the risk of beating a dead horse... odfWeave can be used on Linux (or anywhere Open Office is available) to create reports that can then be converted to Word, rtf, html, pdf etc. In still in the process of getting Impress (OO's presentation application) working, but I'll get there. Max

Re: [R] tune.svm

2007-03-14 Thread Kuhn, Max
Fast is a relative term. Tell us more about your version, system, data and the kernel that you are using (I'm guessing it is a RBF). If you are building a classification model and there are two classes, the svmpath package can be used to get quick predictions over the cost/regularization

Re: [R] plot.tune

2007-03-14 Thread Kuhn, Max
Aimin, Please see color.palette in ?plot.tune. Sorry to be a broken record, but if you want people to help you, you should: - read the help pages before sending an email - run sessionInfo() and send it in the email You run the risk of people ignoring your emails. These steps will help

Re: [R] knncat question

2007-03-12 Thread Kuhn, Max
Aimin, I haven't used that function and you haven't old us anything about your data or the system that you are on, but here is a guess: when the number of votes are tied, a random choice is usually made between the classes. 0.63 and 0.67 are relatively close and this might account for the

Re: [R] RDA and trend surface regression

2007-02-27 Thread Kuhn, Max
: Kuhn, Max Subject: RE: [R] RDA and trend surface regression Thanks a lot for your answers, I am concerned by your advice not to use polynomial constraints, or to use QDA instead of RDA. My final goal is to perform variation partitioning using partial RDA to assess the relative importance

Re: [R] RDA and trend surface regression

2007-02-26 Thread Kuhn, Max
Helene, You will have to give us more information, such as your system/versions and a small reproducible example. We try to stress that questions are more easily answered when there are a lot of specific details given and a reproducible case can be tested. Here are two comments though: 1. The

Re: [R] R in Industry - new SIG

2007-02-08 Thread Kuhn, Max
). Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kuhn, Max Sent: Tuesday, February 06, 2007 5:10 PM To: Doran, Harold; R-help@stat.math.ethz.ch Subject: Re: [R] R in Industry As someone who has (reluctantly) sent job postings to R Help, I think

Re: [R] abbreviate dataframe for Sweave output

2007-02-07 Thread Kuhn, Max
Chris, You might be able to get it using format. You would have to convert the data frame to a matrix if you want the row names to be dots too. foo - function(x, top = 3, ...) { if(dim(x)[1] top + 3) stop(not enough rows) charX - format(x, ...) charX - charX[c(1:(top+2),

Re: [R] R in Industry

2007-02-06 Thread Kuhn, Max
As someone who has (reluctantly) sent job postings to R Help, I think that a SIG would be a good idea. Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold Sent: Tuesday, February 06, 2007 2:08 PM To: R-help@stat.math.ethz.ch Subject: [R] R

Re: [R] Compare effects between lm-models

2007-01-22 Thread Kuhn, Max
You can use the anova function a la: anova(model1, model2) Analysis of Variance Table Model 1: y ~ x Model 2: y ~ x + z Res.DfRSS Df Sum of Sq F Pr(F) 1 13 4.4947 2 12 4.4228 10.0720 0.1952 0.6665 I would suggest

Re: [R] odfWeave and figures in MS Word Format

2007-01-09 Thread Kuhn, Max
Laurent, Since you question was not about odfWeave (despite the message title), it would have been better to send this question to an OpenOffice mailing list. That said, I think that the issues was your workflow (odt - html - doc). HTML is plain text, so when you saved the file in that format

Re: [R] bug in odfWeave

2007-01-02 Thread Kuhn, Max
I've verified this bug and will be releasing a new version shortly. Max -Original Message- From: Abhijit Dasgupta [mailto:[EMAIL PROTECTED] Sent: Saturday, December 23, 2006 12:03 AM To: r-help@stat.math.ethz.ch; Kuhn, Max Subject: bug in odfWeave Hi, I think there is a minor bug

Re: [R] Nicely formatted tables

2006-12-14 Thread Kuhn, Max
How about: apply(iris[, 1:4], 2, summary) Sepal.Length Sepal.Width Petal.Length Petal.Width Min. 4.300 2.0001.000 0.100 1st Qu.5.100 2.8001.600 0.300 Median 5.800 3.0004.350 1.300 Mean 5.843

Re: [R] odfTable: how to escape

2006-11-27 Thread Kuhn, Max
Francesco, odfTable writes out a table in xml format directly into an xml file. The issues is that the characters and (among others) have to be converted to gt; and lt;. I will build a new version where this happens automatically. In the meantime, you should be able to use the colnames

[R] Job Opportunity - Pfizer

2006-11-17 Thread Kuhn, Max
Pfizer Global Research and Development is seeking non-clinical statisticians to support several areas of the drug development pipeline. Positions available in Connecticut are: - a non-clinical statistician to support non-clinical areas of RD, including: Discovery, Drug Safety RD, and the

Re: [R] R CMD BATCH: unable to start device PNG

2006-11-03 Thread Kuhn, Max
Whoops. I hit the wrong button! Here's the whole message: And on that note, here is a function that I use to get around it: startPNG - function(filename, width = 680, height = 990, ...) { nativePNG - capabilities(png) if(nativePNG) { png(file = filename, width = width,

Re: [R] R CMD BATCH: unable to start device PNG

2006-11-03 Thread Kuhn, Max
And on that note, here is a function that I use to get around it: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Horner Sent: Friday, November 03, 2006 10:01 AM To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: Re: [R] R CMD BATCH:

Re: [R] odfWeave help

2006-09-19 Thread Kuhn, Max
Alfonso, It sounds like unzip and zip are not in your path (as opposed to odfWeave needing additional configuration). The error message that you received is generated when odfWeave is invoked. It checks to see if unzip can be used at the command line. After googling, I found a basic link for

[R] [R-pkgs] odfWeave Version 0.4.4

2006-09-07 Thread Kuhn, Max
Version 0.4.4 of odfWeave is available from CRAN. A Windows binary should be available shortly. This version requires base R version 2.3.1 or greater. Changes from the last version include - Non-English character sets are handled better. For example, Chinese characters can be included in R

[R] unlink disables help?

2006-08-17 Thread Kuhn, Max
I was hoping that someone could try to reproduce an error that I am getting. The R Site Search keeps timing out on me, so apologies of this has already come up. I'm using R.version _ platform i386-pc-mingw32 arch i386

[R] [R-pkgs] Version 0.4.3 of odfWeave

2006-07-29 Thread Kuhn, Max
A new version of odfWeave is on CRAN. Changes include: - handling of locales. Errors were being produced when locales were set to anything but C. The fix changes the locale to C and changes back to the original locale when the user's code is executed. - a bug fix for default plot device units

[R] Sweave and tth

2006-07-26 Thread Kuhn, Max
Dr. Harrell, I tried odfWeave to create an OpenOffice file and found that it exhausted the memory of my large linux machine and took a long time to run. Do you have any details about the problem that you encountered? A bug that someone else had pointed out might be the culprit. I have the

[R] Output and Word

2006-07-19 Thread Kuhn, Max
On page 2 of the manual, Section 2 (Requirements) has The package also requires a utility to zip and unzip compressed files, such as unzip, Winzip or jar. With a footnote that unzip can be found at http://www.info-zip.org/ for free. You can use any utility that can zip/unzip pkzip

[R] [R-pkgs] odfWeave Package

2006-07-19 Thread Kuhn, Max
The odfWeave package is now available on CRAN at http://lib.stat.cmu.edu/R/CRAN/src/contrib/Descriptions/odfWeave.html and your local mirror. The package extends Sweave to Open Document Format (ODF) text document files. Latex-style code chunks and in-line Sexpr commands can be used to embed R

[R] [R-pkgs] odfWeave Package

2006-07-18 Thread Kuhn, Max
I've been meaning send an announcement for this package, but Greg Snow beat me to the punch today. Max snip The odfWeave package is now available on CRAN at http://lib.stat.cmu.edu/R/CRAN/src/contrib/Descriptions/odfWeave.html and your local mirror. The package extends Sweave to Open

[R] FW: Levels and GLM

2006-07-07 Thread Kuhn, Max
One correction... since you are fitting a logistic model, it is technically correct to say the mean value of the linear predictor, instead of mean response. 20 lashes for me. Max -Original Message- From: Kuhn, Max Sent: Friday, July 07, 2006 4:11 PM To: 'r-help@stat.math.ethz.ch

[R] Key titles in Lattice

2006-06-01 Thread Kuhn, Max
Hi, I'm creating some lattice plots that have a key and I'd like to put a label on the key. The problem is that the text label for the key prevents the values of the group variables from being shown (see example below). I don't think that this is a feature, but I might be abusing the title arg

Re: [R] Key titles in Lattice

2006-06-01 Thread Kuhn, Max
Peter and Sundar, Thanks, I did miss that. I used: key = list( title = More Text, cex.title = 1, columns = 2, text=list( to get what I wanted. Max -Original Message- From: P Ehlers [mailto:[EMAIL PROTECTED] Sent: Thursday, June 01, 2006 4:14 PM To: Kuhn, Max Cc: r

[R] boosting - second posting

2006-05-30 Thread Kuhn, Max
The family arg appears to be the problem. Either bernoulli or adaboost are appropriate for classification problems. Max Perhaps by following the Posting Guide you're likely to get more helpful responses. You have not shown an example that others can reproduce, not given version information

[R] ISO R-programming docs/refs

2005-10-17 Thread Kuhn, Max
KJ, In my job I write custom computer programs for data analysis, which are used in our company's consulting business. Whenever I've needed statistical analyses I've coded the algorithms myself, but my boss wants me to start learning and using R, to speed up development. I'm curious as to what

[R] Multiple density plots on 1 graph

2005-09-21 Thread Kuhn, Max
Emma, One way is to use lattice: test - data.frame(y = rnorm(5 * 50), groupings = rep(letters[1:5], 50)) library(lattice) densityplot( ~ y, group = groupings, data =test) HTH, Max emma hartnett emma_hartnett at yahoo.co.uk Wed Sep 21 17:57:44 CEST 2005 * Previous message:

[R] SOS Boosting

2005-07-12 Thread Kuhn, Max
Hi, I am trying to implement the Adaboost.M1. algorithm as described in The Elements of Statistical Learning p.301 I don't use Dtettling 's library boost because : - I don't understande the difference beetween Logitboost and L2boost - I 'd like to use larger trees than stumps. It also

[R] errorest

2005-06-23 Thread Kuhn, Max
Jenny, It didn't work and They worked aren't very specific. Also, the package name is ipred and the function is errorest. The estimator entry on the man page for errorest has: 'cv' cross-validation, 'boot' bootstrap or '632plus' bias corrected bootstrap (classification only). Note the