[R] best.svm

2005-05-24 Thread Stephen Choularton
Hi I am trying to fit an svm to predict speech recognition errors. I am using best.svm like this: svm.model = best.svm(data[1:3000,1:23],data[1:3000,24],tunecontrol = tune.control()) I got this: print(svm.model) Call: best.svm(x = data[1:3000, 1:23], tunecontrol = tune.control(),

Re: [R] Can't reproduce clusplot princomp results.

2005-05-24 Thread Bjørn-Helge Mevik
Thomas M. Parris writes: clusplot reports that the first two principal components explain 99.7% of the variability. [...] loadings(pca) [...] Comp.1 Comp.2 Comp.3 Comp.4 SS loadings 1.00 1.00 1.00 1.00 Proportion Var 0.25 0.25 0.25 0.25 Cumulative Var

Re: [R] How to break an axis?

2005-05-24 Thread joerg van den hoff
Bo Peng wrote: Dear list, I need to plot four almost horizontal lines with y-values around 1,3,4, 400. If I plot them directly, the first three lines will be indiscernible so I am thinking of breaking y-axis into two parts, one with range (0,5), another (395,400). Is there an easy way to do

Re: [R] How to break an axis?

2005-05-24 Thread Jim Lemon
Bo Peng wrote: Dear list, I need to plot four almost horizontal lines with y-values around 1,3,4, 400. If I plot them directly, the first three lines will be indiscernible so I am thinking of breaking y-axis into two parts, one with range (0,5), another (395,400). Is there an easy way to do

Re: [R] contourLines() starts a plot device

2005-05-24 Thread Barry Rowlingson
Pierre Kleiber wrote: I want to use contourLines() to get contour line coordinate vectors, but I don't want to make a plot. However contourLines() insists on opening a graphics device. Is there a way tell it not to do this? contourLines() calls .Internal(contourLines(...)), and that calls

[R] Catching an error with lm()

2005-05-24 Thread Ajay Narottam Shah
Folks, I'm in a situation where I do a few thousand regressions, and some of them are bad data. How do I get back an error value (return code such as NULL) from lm(), instead of an error _message_? Here's an example: x - c(NA, 3, 4) y - c(2, NA, NA) d - lm(y ~ x) Error in lm.fit(x, y, offset

Re: [R] Catching an error with lm()

2005-05-24 Thread Gabor Grothendieck
On 5/24/05, Ajay Narottam Shah [EMAIL PROTECTED] wrote: Folks, I'm in a situation where I do a few thousand regressions, and some of them are bad data. How do I get back an error value (return code such as NULL) from lm(), instead of an error _message_? Here's an example: x - c(NA, 3,

[R] image() and non-well-ordered colours

2005-05-24 Thread Robin Hankin
Hi. I want to use image() with colours that are indexed by two variables. Indexing by one variable is easy: library(colorspace) x - seq(from=0, to=1,len=30) z - outer(x,1i*x,+) image(Re(z),col=hcl(seq(from=0,to=100,len=15),c=100)) OK, so far so good. Now, I want the colour to be a more

Re: [R] Re: S4 method inheritance

2005-05-24 Thread Duncan Murdoch
Ross Boylan wrote: On Mon, 2005-05-23 at 14:41 -0700, Ross Boylan wrote: Finally, I'm a bit concerned that one article mentioned that S4 inheritance, in practice, is used mostly for data, not methods (Thomas Lumley, R News 4(1), June 2004: p. 36). Am I going down a road I shouldn't

Re: [R] Tracking progress during iterations

2005-05-24 Thread Gabor Grothendieck
On 5/24/05, Dr L. Y Hin [EMAIL PROTECTED] wrote: Dear all, I am using R 2.1.0 for Windows on XP SP2. In a loop such as below, we can track the progress by a screen print display as below (in S): for (i in 1:10){ print(paste(Starting simulation run no...,i))

Re: [R] Tracking progress during iterations

2005-05-24 Thread Dimitris Rizopoulos
take a look at rw-FAQ 6.13 I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/336899 Fax: +32/16/337015 Web:

Re: [R] skewness and kurtosis in e1071 correct?

2005-05-24 Thread Dirk Enzmann
To me your answer is opaque (but that seems to be rather a problem of language ;-) ). Perhaps my question has not been expressed clearly enough. Let me state it differently: In the R package e1071 the formulas (implicit) used are (3) and (4) (see below), the standard deviation used in these

Re: [R] skewness and kurtosis in e1071 correct? (correction)

2005-05-24 Thread Dirk Enzmann
I'm sorry, but my previous message, as often happens, some brackets were wrong: Here are the correct formulas: sd = 1/n * sum((x-mean(x))^2) # (1) sd = 1/(n-1) * sum((x-mean(x))^2) # (2) This also occured in the last paragraph. Dirk * Dr.

Re: [R] best.svm

2005-05-24 Thread David Meyer
Stephen: you need to supply the parameter ranges, your call did not tune anything at all. best.svm() is really just a wrapper for tune.svm(...)$best.model. The help page for 'tune()' will tell you more on the available options. HTH, David [...] svm.model =

Re: [R] Re: S4 method inheritance

2005-05-24 Thread Robert Gentleman
Duncan Murdoch wrote: Ross Boylan wrote: On Mon, 2005-05-23 at 14:41 -0700, Ross Boylan wrote: Finally, I'm a bit concerned that one article mentioned that S4 inheritance, in practice, is used mostly for data, not methods (Thomas Lumley, R News 4(1), June 2004: p. 36). Am I going

Re: [R] lme4 package and importIntoEnv errors

2005-05-24 Thread Douglas Bates
Deepayan Sarkar wrote: On Monday 23 May 2005 09:48 pm, Patrick Connolly wrote: I've used packages for some years now and seldom had any trouble using the tgz files. Now I've come across something I've never seen before. version _ platform i686-pc-linux-gnu arch i686 os

[R] Erro loading library from apache

2005-05-24 Thread Cristiane Rocha
Hello, I'm having an error message when I try to load the som library from a cgi. I call the library function setting the path to the library directory: library(som, lib.loc=/usr/local/lib/R/library/) When I run my script via web the following error appears in the apache log: Error: package

[R] rotate pie chart

2005-05-24 Thread Lars
hey, about two weeks ago i posted a question concerning the display of two piecharts on one plot. after now being able to do so, i need to rotate them. the first piece of my pie is suppose to start at 0° but at 90°. i tried several things, all failing in the end. anyone out there who has an

[R] You have added paul_king_man@yahoo.com to your Paypal account

2005-05-24 Thread [EMAIL PROTECTED]
You have added [EMAIL PROTECTED] as a new email address for your PayPal account. If you did not authorize this change or if you need assistance with your account, please contact PayPal customer service at: [1]https://www.paypal.com/row/wf/f=ap_email Thank you for using PayPal!

Re: [R] rotate pie chart

2005-05-24 Thread Sean Davis
You might want to look at grid graphics and gridBase. I don't know in detail how to go about what you are asking, but grid allows you to rotate plots arbitrarily. Here are a couple of links that I think are useful. http://www.stat.auckland.ac.nz/~paul/grid/grid.html

[R] Basic matematical functions with NAs

2005-05-24 Thread Paulo Brando
Dear All, I've tried to sum columns -- different species of flowers, fruits plus twigs -- with NAs to get litterfall/trap, and then after use litterfall to calculate production (litterfall (grams)/ hectare/ day. But R 'sees' litterfall/trap as a string. My question: How to use basic

Re: [R] Re: S4 method inheritance

2005-05-24 Thread Thomas Lumley
On Mon, 23 May 2005, Ross Boylan wrote: On Mon, 2005-05-23 at 14:41 -0700, Ross Boylan wrote: Finally, I'm a bit concerned that one article mentioned that S4 inheritance, in practice, is used mostly for data, not methods (Thomas Lumley, R News 4(1), June 2004: p. 36). Am I going down a

Re: [R] Basic matematical functions with NAs

2005-05-24 Thread roger bos
Simple, all those functions, such as sum(), colSums(), colMeans(), etc. have an argument called na.rm which you can set to TRUE to remove NAs. so try something like sum(X, na.rm=TRUE) HTH, Roger On 5/24/05, Paulo Brando [EMAIL PROTECTED] wrote: Dear All, I've tried to sum columns --

Re: [R] How to break an axis?

2005-05-24 Thread Bo Peng
Tom Mulholland has already pointed out that the plotrix package has an axis.break() function that will draw the break symbol. Your problem is a combination of plotting two disparate sets of data and getting the y-axis right. The following is one way to do it, just be careful that the ylim=

[R] Ein R und backslash-Problem

2005-05-24 Thread Kerstin Andreas
Hallo Uwe Ligges, Ich habe Sie durch die Seite: https://stat.ethz.ch/pipermail/r-help/2000-May/005313.html gefunden und bräuchte Ihre Hilfe. Mein Freund schreibt Diplomarbeit in R und Latex, doch er bekommt es nicht hin, dass er in R einen String mit dem Backslash (einen Latexbefehl) eingeben

Re: [R] Returning from a function

2005-05-24 Thread Duncan Murdoch
Liaw, Andy wrote: Use invisible(NULL) as the last line. Or nothing at all, in which case the result of the last executed line will be returned. If your function does plotting, the last line is probably one of the graphics functions, and they typically return invisible results. Another

Re: [R] Ein R und backslash-Problem

2005-05-24 Thread Achim Zeileis
Kerstin, first of all, this is the R-help mailing list and not the private address of: Hallo Uwe Ligges, Furthermore, the official language on the list is English. Ich habe Sie durch die Seite: https://stat.ethz.ch/pipermail/r-help/2000-May/005313.html gefunden und bräuchte Ihre Hilfe.

[R] reading multiple files

2005-05-24 Thread Dave Evens
Dear All, How do I read in multiple data frames or matrices in a loop, e.g. for (i in 1:n) { channel - odbcConnectExcel(filenames) file[i] - as.data.frame(sqlFetch(channel, sheet)) } I would like file[i] to be the name of the data.frame (i.e. file[1], file[2], file[3],...etc) rather

[R] How to get special (Hershey) font symbols into plot axis labels? [Revisited]

2005-05-24 Thread Sander Oom
Dear R users, I would like to use sub- and super-script in axis labels. I assume this is best done using Hershey symbols. When trying to find information on using Hershey font symbols in axis labels, I came across the following discussion thread:

RE: [R] reading multiple files

2005-05-24 Thread bogdan romocea
You're almost there, use a list: myfiles - list() for (i in 1:n) myfiles[[i]] - etc You can then get at your data frames with myfiles[[1]], myfiles[[2]]... Or, if you prefer to combine them into a single data frame (assuming they're similar), allmyfiles - do.call(rbind,myfiles) -Original

Re: [R] skewness and kurtosis in e1071 correct?

2005-05-24 Thread Dirk Enzmann
My last question to the R list is another example of asking too fast before reading (sorry). But by the way and because it might be interesting for others, an answer can be found in: Joanes, D. N. Gill, C. A. (1998) Comparing measures of sample skewness and kurtosis. Journal of the Royal

[R] R unable to run on Mac OS 10.4 Tiger

2005-05-24 Thread Guillaume Chapron
Hello, I'm running a PB G4 with Mac OS 10.4.1. I have downloaded the latest version R-2.1.0a.dmg. It appears that R does not work. It launches itself, but the window never gets ready, there is written Loading R... and a small progress wheel keeps turning indefinitely. Could someone help or

Re: [R] R unable to run on Mac OS 10.4 Tiger

2005-05-24 Thread Federico Calboli
On Tue, 2005-05-24 at 18:05 +0200, Guillaume Chapron wrote: Hello, I'm running a PB G4 with Mac OS 10.4.1. I have downloaded the latest version R-2.1.0a.dmg. It appears that R does not work. It launches itself, but the window never gets ready, there is written Loading R... and a small

[R] plot in a two dimension surface with more than 2 variables

2005-05-24 Thread Amir Safari
Dear All , How it is possible to trace a plot in a two dimension surface with more than 2 variables? ps: library( rgl) is 3D So many THANKS - [[alternative HTML version deleted]] __

Re: [R] R unable to run on Mac OS 10.4 Tiger

2005-05-24 Thread Rob J Goedman
Hi Guillaume, There is a R-SIG-Mac alias where many of these questions are being addressed. The most likely reason is that you have a .RData file around that its trying to load. It might be missing a library or trying to connect to X11. Can you check for that 1st in a terminal window (ls

[R] obtaining first and last record for rows with same identifier

2005-05-24 Thread sms13+
I have a dataframe that contains fields such as patid, labdate, labvalue. The same patid may show up in multiple rows because of lab measurements on multiple days. Is there a simple way to obtain just the first and last record for each patient, or do I need to write some code that performs

Re: [R] obtaining first and last record for rows with same identifier

2005-05-24 Thread Sean Davis
If you have your data.frame ordered by the patid, you can use the function rle in combination with cumsum. As a vector example: a - rep(c('a','b','c'),10) a [1] a b c a b c a b c a b c a b c a b c a [20] b c a b c a b c a b c b - a[order(a)] b [1] a a a a a a a a a a b b b b b b b b b

RE: [R] obtaining first and last record for rows with same identifier

2005-05-24 Thread Berton Gunter
I think by() is simpler: by(yourframe,factor(yourframe$patid),function(x)x[c(1,nrow(x)),]) -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original

Re: [R] Re: S4 method inheritance

2005-05-24 Thread Ross Boylan
On Tue, May 24, 2005 at 07:07:07AM -0400, Duncan Murdoch wrote: Ross Boylan wrote: On Mon, 2005-05-23 at 14:41 -0700, Ross Boylan wrote: Finally, I'm a bit concerned that one article mentioned that S4 inheritance, in practice, is used mostly for data, not methods (Thomas Lumley, R

[R] Is anyone working on an S4 classes for dummies book/paper? If so, please contact me off-list

2005-05-24 Thread A.J. Rossini
Is anyone working on an S4 classes for dummies book/paper/package? If so, please contact me off-list. best, -tony Commit early,commit often, and commit in a repository from which we can easily roll-back your mistakes (AJR, 4Jan05). A.J. Rossini [EMAIL PROTECTED]

Re: [R] colors and palettes and things...

2005-05-24 Thread Earl F. Glynn
Jeff D. Hamann [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] After trying to find if there was a color picker in the FAQs and the help, I thought I would send a post here. I was overwhelmed with all the wonderful color choices R has predefined (discovered after typing in colors())

[R] Question on read.table

2005-05-24 Thread Dubé, Eric
Hi This is possbible to read AREMOS file with read.table function. The AREMOS format come from DRI-WEFA and is uses with Eviews Thanks *** AVIS DE NON-RESPONSABILITE:\ Ce document transmis par

Re: [R] Re: S4 method inheritance

2005-05-24 Thread Ross Boylan
On Tue, May 24, 2005 at 06:27:56AM -0700, Robert Gentleman wrote: Duncan Murdoch wrote: Ross Boylan wrote: On Mon, 2005-05-23 at 14:41 -0700, Ross Boylan wrote: Finally, I'm a bit concerned that one article mentioned that S4 inheritance, in practice, is used mostly for data,

[R] input line length in Sweave

2005-05-24 Thread Woodrow Setzer
I am having trouble in Sweave with input line lengths. For example, I may have in my input file the chunk = BrainSections - levels(AggData$sctn)[grep( (^BRAIN)|(^WHOLEBRAIN)|(LEFT HEMISPHERE)| (HALFBRAIN), levels(AggData$sctn))] @ This is translated in the

Re: [R] Hmisc/Design and problem with cgroup

2005-05-24 Thread Uwe Ligges
Frank E Harrell Jr wrote: Uwe Ligges wrote: Aric Gregson wrote: On 5/17/05 21:44 Frank E Harrell Jr sent the following: Aric Gregson wrote: Hello, I am trying to use the following to output a table to latex: cohortbyagesummary - by(data.frame(age,ethnicity), cohort, summary) w -

[R] How to use fixed-width fonts such as courier in R

2005-05-24 Thread Xiang Li
Hi, I am trying to use Arial bold for labelling (font.lab =2), and use the fixed-width Courier bold for axis. I will export the plot to .ps format. I have been trying to use font.axis = 11, but that doesn't work when I exported the plot to a .ps file. I have been trying hard to read the help

[R] Missing Data Line Type?

2005-05-24 Thread khobson
I have a general question. Is there a setting that can be used for a multiple line type? The situation is that I want a solid line between x and y points but if the y point is missing, I want a dashed line type to the next point. In other words, if point 1 to 2 exists, make that line solid,

[R] Table Help

2005-05-24 Thread McMurtry, Benjamin G.
Reply to sender Reply to all Reply to folder Forward Move/Copy Delete Read previous item Read next item Get help information on the current window From: McMurtry, Benjamin G. To: '[EMAIL PROTECTED]' Cc: Subject:Table Help Sent: 5/24/2005 4:33 PM

[R] Plot range resizing when adding additiona lines

2005-05-24 Thread Hikel, Jerry
Hi -- I have searched the documentation and archives on graphing capabilities in R for the past couple of hours, but I haven't been able to find anything directly related to my problem. I want to create a plot with several lines displayed on it. I want each line to be displayed in a different

[R] Table Help

2005-05-24 Thread McMurtry, Benjamin G.
I have a very large table that I want to add some of the certain rows. The table is as follows: Username1 2 Username1 4 Username2 6 Username2 10 Username3 12 Username3 10 Username3 16 Etc The data is sorted by Column 1 (Ie the username) then by columm 2 (The numbers). I do not know how

Re: [R] lme4 package and importIntoEnv errors

2005-05-24 Thread Patrick Connolly
On Tue, 24-May-2005 at 08:40AM -0500, Douglas Bates wrote: | Perhaps I can add a bit more explanation. As Deepayan mentioned, the | versions of the lme4 package are closely linked to the versions of the | Matrix package. The R code for lmer is in the lme4 package but the | corresponding C

[R] output of mars() in package mda; how do I read the pairwise interaction terms from the output?

2005-05-24 Thread Jude Ryan
Hi, I have run mars() with the default degree=1, and have constructed splines which are similar to what I would get from Salford System's MARS. I then use these splines as potential predictors, along with rpart( ) terminal nodes and other potential predictors, in logistic regression in SAS.

Re: [R] Table Help

2005-05-24 Thread Sean Davis
see ?aggregate Sean On May 24, 2005, at 4:39 PM, McMurtry, Benjamin G. wrote: Is there easy way using a feature like bind to sum all of collumn two where column 1 is the same? __ R-help@stat.math.ethz.ch mailing list

[R] in other words Re: How to use fixed-width fonts such as courier in R

2005-05-24 Thread Xiang Li
the problem is how to use both courier bold font for axis and arial bold font for labelling. If I use familiy = courier in postscript, everything will become courier fonts .. I noticed that in postscirpt help page, we can customize a family such as family =

RE: [R] Plot range resizing when adding additiona lines

2005-05-24 Thread Wiener, Matthew
In traditional, or base graphics, see matplot, which does exactly what you describe. You can also look at lattice graphics, which will give you flexibility to plot in a single panel or multiple panels. Hope this helps, Matt Wiener -Original Message- From: [EMAIL PROTECTED]

Re: [R] Plot range resizing when adding additiona lines

2005-05-24 Thread Sander Oom
Hikel, Jerry wrote: Hi -- I have searched the documentation and archives on graphing capabilities in R for the past couple of hours, but I haven't been able to find anything directly related to my problem. I want to create a plot with several lines displayed on it. I want each line to be

RE: [R] Plot range resizing when adding additiona lines

2005-05-24 Thread Hikel, Jerry
That's what i wound up doing -- i am totally new to R, so i wasn't sure if there were an easy way of getting the min and max values of a data frame, but i tried that and it worked out well. Thanks. -Original Message- From: Sander Oom [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 24, 2005

RE: [R] Missing Data Line Type?

2005-05-24 Thread OlsenN
The dashed line can be added to the plot with a call to lines after removing the NAs from your x/y vectors (I'm assuming 'missing' means NA). plot(x,y,type='l') lines(x[!is.na(y)],y[!is.na(y)],lty=2) Vertical lines can be accomplished with segments. norm -Original Message- From:

Re: [R] rotate pie chart

2005-05-24 Thread Paul Murrell
Hi gridBase won't help here (grid can't rotate traditional graphics output). I think you have to get your hands dirty on this one, but it's not too hard. Here's a function pie90() which is a tiny modification of pie(). Does that do the trick? pie90 - function (x, labels = names(x), edges

Re: [R] in other words Re: How to use fixed-width fonts such as courier in R

2005-05-24 Thread Xiang Li
Great. Thanks a lot. That is exactly what I need. Xiang On Wed, 25 May 2005, Paul Murrell wrote: Hi Does this do what you want? postscript(example.ps, fonts=c(sans, mono)) plot(1:10, axes=FALSE, ann=FALSE) par(family=sans) # By default Helvetica which is like Arial title(xlab=sans serif

[R] Contingency tables from data.frames

2005-05-24 Thread Jose Claudio Faria
Dear list, I'm trying to do a set of generic functions do make contingency tables from data.frames. It is just running nice (I'm learning R), but I think it can be better. I would like to filter the data.frame, i.e, eliminate all not numeric variables. And I don't know how to make it:

Re: [R] Contingency tables from data.frames

2005-05-24 Thread Gabor Grothendieck
On 5/24/05, Jose Claudio Faria [EMAIL PROTECTED] wrote: Dear list, I'm trying to do a set of generic functions do make contingency tables from data.frames. It is just running nice (I'm learning R), but I think it can be better. I would like to filter the data.frame, i.e, eliminate all not

Re: [R] image() and non-well-ordered colours

2005-05-24 Thread Paul Murrell
Hi Robin Hankin wrote: Hi. I want to use image() with colours that are indexed by two variables. Indexing by one variable is easy: library(colorspace) x - seq(from=0, to=1,len=30) z - outer(x,1i*x,+) image(Re(z),col=hcl(seq(from=0,to=100,len=15),c=100)) OK, so far so good. Now, I want the

Re: [R] Re: S4 method inheritance

2005-05-24 Thread Robert Gentleman
Ross Boylan wrote: On Tue, May 24, 2005 at 06:27:56AM -0700, Robert Gentleman wrote: Duncan Murdoch wrote: Ross Boylan wrote: On Mon, 2005-05-23 at 14:41 -0700, Ross Boylan wrote: Finally, I'm a bit concerned that one article mentioned that S4 inheritance, in practice, is used

RE: [R] obtaining first and last record for rows with same identifier

2005-05-24 Thread Francisco J. Zagmutt
If you want to obtain a data frame you can use the functions head and tail like: dat=data.frame(id=rep(1:5,3),num=rnorm(15), num2=rnorm(15))#Creates data frame with id last=do.call(rbind,by(dat,dat$id,tail,1))#Selects the last observation for each id