Re: [R] Learning R

2009-11-29 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Julia, see http://www.r-project.org/ -> Documentation -> Manuals (-> An introduction to R) (or use: http://cran.r-project.org/manuals.html) for a starting point. In addition, you might want to check the annotated list of books to see which one might best fit your needs: http://www.r-project.o

Re: [R] Continuous legend colors

2009-11-29 Thread Tim Clark
Thanks Jim, that is exactly what I was looking for! Tim Tim Clark Department of Zoology University of Hawaii --- On Sun, 11/29/09, Jim Lemon wrote: > From: Jim Lemon > Subject: Re: [R] Continuous legend colors > To: "Tim Clark" > Cc: r-help@r-project.org > Date: Sunday, November 29, 2009,

[R] Learning R

2009-11-29 Thread Julia Cains
Dear R helpers, Almost 15 days back I have become member of this very active and wonderful group. So far I have been only raising  queries and in turn got them solved too and I really thank for the spirit this group member show when it comes to the guidance. I wish to learn R language and I ha

[R] Little help needed

2009-11-29 Thread dovii
So, I need some serious help with an R project. The project essentially consists of some problems that have to be analyzed to decide the correct statistical test to use, and then correctly use R to answer them. The use of an instant messaging service for this would probably be great. I am willi

[R] updating subset of data.frame

2009-11-29 Thread Rnewb
i have a data frame and a numeric vector indexed as a subset of the rows in the data.frame. what command can i use to assign the values in the vector to the appropriate rows of the data.frame? here's my failed attempt. what i would want is data[1,'z'] == 2, data[5,'z'] == -4, data[8,'z'] == -5,

Re: [R] how to put ggobi display into a GUI window setup by gWidgets

2009-11-29 Thread jerry83
Hi John, Thanks A LOT for your reply and the code. What I want to do is to include the ggobi display window to the widget window setup by me. I tried add before but it said can not do it for GGobiScatterplotDisplay. Do you have any idea about add displays? Thanks again for your help.  

Re: [R] Assign palette (e.g. rainbow) to a series of points on 1 plot

2009-11-29 Thread Frostygoat
Thanks for the suggestion David. With mapply the lines are correctly plotted but they are all red, the points are colored, but along the x axis, not along the individual lines. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Matthieu Stigler
Yes, was wondering that other code line did not change so much :-) Thanks a lot! 2009/11/30 Gabor Grothendieck : > > > On Sun, Nov 29, 2009 at 9:16 AM, Gabor Grothendieck > wrote: >> >> By the way, if you really do want to create the formula anyways then: >> >>    ix <- 1:2 >>    left <- paste(n

Re: [R] Continuous legend colors

2009-11-29 Thread Jim Lemon
On 11/30/2009 03:22 PM, Tim Clark wrote: Dear List, I am trying to get a basic plot to show a continuous range of fill colors. It is probably easiest to demonstrate. I would like a legend like in the following example: Satellite.Palette<-colorRampPalette(c("blue3","cyan","aquamarine","yello

Re: [R] sequence of commands in R

2009-11-29 Thread Jim Lemon
On 11/30/2009 07:17 AM, Manuel Jesús López Rodríguez wrote: Dear all, I would like to know how could I execute a sequence or orders with just a function, i.e, that just typing the function name, R gives me all the parameters I want (for instance, if I want to see the summary, the standard devi

Re: [R] Kohonen Package

2009-11-29 Thread Peter Ehlers
This turns out to be easy. What you need are the locations where to put the labels and those are given in the som object. Using your code: mysom <- som(wines.sc, grid=somgrid(5, 5, "hexagonal")) plot(mysom, type="dist.neighbours" ) # check what's contained in mysom: str(mysom) # we need the $gr

Re: [R] updating subset of data.frame

2009-11-29 Thread Jorge Ivan Velez
Hi Rnewb, Take a look at ?"%in%" . HTH, Jorge On Sun, Nov 29, 2009 at 11:06 PM, Rnewb <> wrote: > > i have a data frame and a numeric vector indexed as a subset of the rows in > the data.frame. what command can i use to assign the values in the vector > to the appropriate rows of the data.fra

Re: [R] Question about output from optim

2009-11-29 Thread Ben Bolker
Sébastien Bihorel free.fr> writes: > > Dear R-users, > > I am trying to port to R something that I wrote in Matlab to perform model > parameter optimization using the Nelder-Mead simplex method (fminsearch). I > read the help on ?optim (which seems to be the way to go) as well as a bunch > of p

Re: [R] Iteration idioms & laziness

2009-11-29 Thread David Duffy
Duncan Murdoch murdoch at stats.uwo.ca wrote: > On 27/11/2009 3:36 PM, Alexander Søndergaard wrote: > I'm new to R. Having a functional background, I was wondering what's > the idiomatic way to iterate. It seems that for loops are the default > given there's no tail-call optimization. > > I'm c

[R] Continuous legend colors

2009-11-29 Thread Tim Clark
Dear List, I am trying to get a basic plot to show a continuous range of fill colors. It is probably easiest to demonstrate. I would like a legend like in the following example: Satellite.Palette <-colorRampPalette(c("blue3","cyan","aquamarine","yellow","orange","red")) require(fields) image

[R] updating subset of data.frame

2009-11-29 Thread Rnewb
i have a data frame and a numeric vector indexed as a subset of the rows in the data.frame. what command can i use to assign the values in the vector to the appropriate rows of the data.frame? here's my failed attempt. what i would want is data[1,'z'] == 2, data[5,'z'] == -4, data[8,'z'] == -5,

[R] Question about output from optim

2009-11-29 Thread Sébastien Bihorel
Dear R-users, I am trying to port to R something that I wrote in Matlab to perform model parameter optimization using the Nelder-Mead simplex method (fminsearch). I read the help on ?optim (which seems to be the way to go) as well as a bunch of posts on the topic, but I would like to make sure abo

Re: [R] Assign palette (e.g. rainbow) to a series of points on 1 plot

2009-11-29 Thread David Winsemius
On Nov 29, 2009, at 9:30 PM, Frostygoat wrote: I have 11 vectors representing insect survival probabilities in response to different levels of toxins at 10 concentrations lx100=c(1,1,1,.8,.5,.4,.2,0) day100=c(0,1,2,3,4,5,6,7,8) lx90=c(1,1,1,1,.9,.8,.6,.4,.2,.1,0) day90=c(0,1,2,3,4,5,6,7,8,9,1

[R] Assign palette (e.g. rainbow) to a series of points on 1 plot

2009-11-29 Thread Frostygoat
I have 11 vectors representing insect survival probabilities in response to different levels of toxins at 10 concentrations lx100=c(1,1,1,.8,.5,.4,.2,0) day100=c(0,1,2,3,4,5,6,7,8) lx90=c(1,1,1,1,.9,.8,.6,.4,.2,.1,0) day90=c(0,1,2,3,4,5,6,7,8,9,10) #...and so on10% and a zero (control) series l

Re: [R] Kohonen Package

2009-11-29 Thread Brock Tibert
Many thanks, Peter, Gavin. That is exactly what it was...and old version. I was running R 2.7 (needed it to integrate with SPSS 17). I know I am a pain, but one last question. Is it possible to overlay a value label onto the maps? In some of the SOMs we have worked through in class, we saw

Re: [R] How do I run to or more R consoles on Mac OS X?

2009-11-29 Thread Sharpie
chronos.phenomena wrote: > > This is really annoying me... when I click R application icon it brings > already opened session in the focus and it DOESN'T open new session > > any ideas? > I don't think this is possible with R.app on OS X. OS X applications do not spawn separate processes

[R] How do I run to or more R consoles on Mac OS X?

2009-11-29 Thread chronos.phenomena
This is really annoying me... when I click R application icon it brings already opened session in the focus and it DOESN'T open new session any ideas? -- View this message in context: http://n4.nabble.com/How-do-I-run-to-or-more-R-consoles-on-Mac-OS-X-tp930979p930979.html Sent from the R he

Re: [R] kernlab's ksvm method freeze

2009-11-29 Thread Heiko Strathmann
I tried out the code you wrote, it also works for me, but it lacks a parameter i use in my code. The problem (at this computer) seems to be this "cross"-parameter of ksvm - if I, for example, add the parameter cross=10, i get the old problem: library("kernlab") load("freeze_workspace.RDATA") repl

Re: [R] sequence of commands in R

2009-11-29 Thread Don MacQueen
You don't see the standard deviations because only the final result (the output of summary() in your case) is output by the function, not the intermediate results (the results of the apply() function in your case). Try this: resumen<-function(x) { print( apply(x,2,sd,na.rm=TRUE))

Re: [R] sequence of commands in R

2009-11-29 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Manuel Jesús López Rodríguez > Sent: Sunday, November 29, 2009 12:17 PM > To: r-help@r-project.org > Subject: [R] sequence of commands in R > > Dear all, > I would like to know

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Gabor Grothendieck
On Sun, Nov 29, 2009 at 9:16 AM, Gabor Grothendieck wrote: > By the way, if you really do want to create the formula anyways then: > >ix <- 1:2 >left <- paste(names(freeny)[ix], collapse = ",") >fo <- as.formula(paste("cbind(", left, ") ~ .")) >lm(fo, freeny) > > or possibly repla

[R] sequence of commands in R

2009-11-29 Thread Manuel Jesús López Rodríguez
Dear all, I would like to know how could I execute a sequence or orders with just a function, i.e, that just typing the function name, R gives me all the parameters I want (for instance, if I want to see the summary, the standard deviation, the number of valid cases, etc of a dataframe just with

Re: [R] optim or nlminb for minimization, which to believe?

2009-11-29 Thread Hans W Borchers
Your function named 'gradient' is not the correct gradient. Take as an example the following point x0, very near to the true minimum, x0 <- c(-0.2517964, 0.4898680, -0.2517962, 0.4898681, 0.7500995) then you get > gradient(x0) [1] -0.0372110470 0.0001816991 -0.0372102284 0.000182

Re: [R] Help: Beanplots calculating wrong average

2009-11-29 Thread Tom Wainwright
On 11/26/2009 02:25 AM, Michael Hopgood wrote: Hi Tom, Thank you for the friendly and informative answer. It does explain a lot of things, actually. As with any good answer, it inevitably leads to other questions. In the first place, I need the arithmetic mean. It's what we base our calculat

Re: [R] Does nargin and nargout work with R functions?

2009-11-29 Thread Jason Rupert
This works great. Thanks for your help. - Original Message From: baptiste auguie To: Jason Rupert Cc: R-help Sent: Thu, November 26, 2009 11:08:57 AM Subject: Re: [R] Does nargin and nargout work with R functions? Hi, I think you can use match.call() to retrieve the number of ar

Re: [R] Why .Diag and .asSparse are not accessible in R sessions?

2009-11-29 Thread Sharpie
Peng Yu wrote: > > How to control what functions/classes are exported to a given namespace? > Namespace exports are set by package authors in the NAMESPACE file of an R package. You could alter the NAMESPACE and rebuild the package yourself, but an easier way would be to just use the ":::" o

Re: [R] How to z-standardize for subgroups?

2009-11-29 Thread Karsten Wolf
Hi Jorge, Chuck and Kane, thanks for your input! The following code based on Jorge's answer did the trick to standardize for subgroups within multiple columns: # define a standardize function, but you could also define your custom standardize function here z.mean.sd <- function(data){ retu

Re: [R] Why .Diag and .asSparse are not accessible in R sessions?

2009-11-29 Thread Peng Yu
How to control what functions/classes are exported to a given namespace? On Sun, Nov 29, 2009 at 3:34 PM, baptiste auguie wrote: > Hi, > > They're not exported from the stats namespace, > > stats:::.Diag > stats:::.asSparse > > ?":::" > > HTH, > > baptiste > > 2009/11/29 Peng Yu : >> '.Diag' and

[R] What are polynomial contrasts?

2009-11-29 Thread Peng Yu
I don't find a good explanation on polynomial contrasts. Could somebody recommend one to me? __ 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 an

Re: [R] How to force regression coeffs for some values in a categorical variable

2009-11-29 Thread David Winsemius
I worry whether you understand what is happening when you lump all the "unwanted levels" into a reference level. Be sure to watch the intercept as you compare models. It will be some sort of adjusted mean for whatever cases are in the reference levels of that and teh reference levels of any

Re: [R] how to put ggobi display into a GUI window setup by gWidgets

2009-11-29 Thread j verzani
jerry83 yahoo.com> writes: > > > Hi, > > I want to put a ggobi display into a GUI window setup by gWidgets, but error > occur said it is not a S4 object. > > Does anyone have any idea about how to put it in or maybe it can not be put > into a widget at all? > > Thanks A LOT! To embed a GT

Re: [R] Orphaned R Packages (maybe this is too inside baseball?)

2009-11-29 Thread Gabor Grothendieck
He is also the author of the rpad package and the email address on that package on CRAN does correspond to a working web site. On Sun, Nov 29, 2009 at 4:33 PM, Jason Rupert wrote: > Dear Uwe, > > Thank you very much for your response. > > Maybe I should take the follow-up discussion about the ope

Re: [R] How to z-standardize for subgroups?

2009-11-29 Thread Chuck Cleland
On 11/29/2009 4:23 PM, John Kane wrote: > http://finzi.psych.upenn.edu/R/library/QuantPsyc/html/Make.Z.html > > Make.Z in the QuantPsych package may already do it. For a single variable, you could use ave() and scale() together like this: with(iris, ave(Sepal.Width, Species, FUN = scale)) T

Re: [R] Why .Diag and .asSparse are not accessible in R sessions?

2009-11-29 Thread baptiste auguie
Hi, They're not exported from the stats namespace, stats:::.Diag stats:::.asSparse ?":::" HTH, baptiste 2009/11/29 Peng Yu : > '.Diag' and '.asSparse' are defined in contrast.R. I'm wondering why I > don't see them in my R session. Is it because that they start with > '.'? > > ___

Re: [R] Orphaned R Packages (maybe this is too inside baseball?)

2009-11-29 Thread Jason Rupert
Dear Uwe, Thank you very much for your response. Maybe I should take the follow-up discussion about the open license issues off line, as I have do not have a great deal of experience with such things, especially with regards to the desired licenses for R packages and the existing license for

Re: [R] How to z-standardize for subgroups?

2009-11-29 Thread John Kane
http://finzi.psych.upenn.edu/R/library/QuantPsyc/html/Make.Z.html Make.Z in the QuantPsych package may already do it. --- On Sun, 11/29/09, Karsten Wolf wrote: > From: Karsten Wolf > Subject: [R] How to z-standardize for subgroups? > To: r-help@r-project.org > Received: Sunday, November 29, 20

[R] Why .Diag and .asSparse are not accessible in R sessions?

2009-11-29 Thread Peng Yu
'.Diag' and '.asSparse' are defined in contrast.R. I'm wondering why I don't see them in my R session. Is it because that they start with '.'? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] How to force regression coeffs for some values in a categorical variable

2009-11-29 Thread sr danda
My model has several independent and categorical variables. I would not like to subset them as other variables in the data are useful. I just wanted to set some coefficients for some levels in a single category. A prototype of it can be something like y + constant * (cat.variable1-Level1) ~ x1 + x2

Re: [R] Has anyone had success with RGTK2/rattle and windows 7 64-bit?

2009-11-29 Thread Uwe Ligges
Graham Williams wrote: I don't have a Windows 7 to test this on yet - works on Vista and XP. Did you install the GTK libraries (separately to R)? I have manually tested on Windows Server 2008 64-bit where it works (with most recent 32-bit binary versions of R, rattle and GTK). Best wishes,

Re: [R] kernlab's ksvm method freeze

2009-11-29 Thread David Winsemius
No "freezes" on a Mac using Ligges' 100 replication script. Tried it twice. They took around a minute each time. -- David. -- David On Nov 29, 2009, at 1:28 PM, Heiko Strathmann wrote: Hello uwe, Thanks for trying out. the freeze happens after about 10 to 20 iterations. Did you try as many

Re: [R] Removing objects from a list based on nrow

2009-11-29 Thread Tim Clark
Jim, Good catch! I know in my current problem there are objects with less than 3 rows, but will make sure to modify the function for future use. Thanks, Tim Tim Clark Department of Zoology University of Hawaii --- On Sun, 11/29/09, Linlin Yan wrote: > From: Linlin Yan > Subject: Re: [R

[R] optim or nlminb for minimization, which to believe?

2009-11-29 Thread Doran, Harold
I have constructed the function mml2 (below) based on the likelihood function described in the minimal latex I have pasted below for anyone who wants to look at it. This function finds parameter estimates for a basic Rasch (IRT) model. Using the function without the gradient, using either nlminb

Re: [R] column of dates into time series

2009-11-29 Thread David Winsemius
On Nov 29, 2009, at 12:41 PM, David Winsemius wrote: On Nov 29, 2009, at 11:59 AM, DispersionMap wrote: ? like this do you mean... Yes. Exactly. Unfortunately that data was passed though the summary function which has done some odd things to the data, to wit: > Weeks[Weeks==189] 2007-

Re: [R] kernlab's ksvm method freeze

2009-11-29 Thread Uwe Ligges
Heiko Strathmann wrote: Hello uwe, Thanks for trying out. the freeze happens after about 10 to 20 iterations. Did you try as many? I just tried again: library("kernlab") load("freeze_workspace.RDATA") replicate(100, ksvm(kernel="matrix", kernelMatrix, trainingDataYs, type="C-svc", C=2)) a

[R] KhmaladzeTest - quantreg

2009-11-29 Thread antonella.cann...@virgilio.it
Hi, I've implemented the KhmaladzeTest for my linear quantile regression model for the location-scale shift hypotesis as follow: >formula=r ~ div + pe + por >Ktest=KhmaladzeTest(formula,nullH="location-scale") > Ktest $nullH [1] "location-scale" $Tn [1] 2.125804 $THn div

Re: [R] kernlab's ksvm method freeze

2009-11-29 Thread Heiko Strathmann
Hello uwe, Thanks for trying out. the freeze happens after about 10 to 20 iterations. Did you try as many? Am Sonntag, den 29.11.2009, 17:22 +0100 schrieb Uwe Ligges: > I just tried > > ksvm(kernel="matrix", kernelMatrix, trainingDataYs, type="C-svc", > cross=10, C=2) > > several times on both

Re: [R] Roman numerical output

2009-11-29 Thread Ben Bolker
Thomas Steiner gmail.com> writes: > > I have integers and I want R to give them back/output as Roman numerals: > s=c(7,17) > format(s,roman=T) help.search("roman",agrep=FALSE) ?as.roman as.roman(c(7,17)) __ R-help@r-project.org mailing list https

[R] Roman numerical output

2009-11-29 Thread Thomas Steiner
I have integers and I want R to give them back/output as Roman numerals: s=c(7,17) format(s,roman=T) is obviously wrong. Is there any other way/function to do this? Thanks, Thomas __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Spectrum confidence interval

2009-11-29 Thread Uwe Ligges
Late answer, but maybe still helpful (if I am correct this question is still unanswered on R-help): Clément Poirier wrote: Dear useRs, I'd like to plot a confidence interval on a periodogram. My problem is that spec.pgram(sunspots,ci=0.95,log="yes") gives me a blue error bar on the plot, b

Re: [R] column of dates into time series

2009-11-29 Thread David Winsemius
On Nov 29, 2009, at 11:59 AM, DispersionMap wrote: ? like this do you mean... Yes. Exactly. Unfortunately that data was passed though the summary function which has done some odd things to the data, to wit: > Weeks[Weeks==189] 2007-03-26 2007-07-09 2007-11-05 2008-02-25 2008-09-08 2009-0

Re: [R] lm() notation question

2009-11-29 Thread Gabor Grothendieck
See the Details section of ?lm where its all discussed. On Sun, Nov 29, 2009 at 11:46 AM, Carl Witthoft wrote: > Hi, > A recent thread provided a (working) construct for lm: > > lm(as.matrix(freeny[ix]) ~., freeny[-ix]) > > > Can someone explain what is meant by the formula in that expression, >

Re: [R] lm() notation question

2009-11-29 Thread Gabor Grothendieck
Sorry. Since . is commonly used but a matrix LHS less so I assumed you were asking about the matrix part. Dot means everything not on the LHS of the formula. On Sun, Nov 29, 2009 at 12:18 PM, Carl Witthoft wrote: > As others helpfully pointed out, the meaning of "." in a formula is > provided i

[R] Rules for coding expanded formulas

2009-11-29 Thread Peng Yu
I'm reading Section 2.4.1 Rules for Coding Expanded Formulas in Statistical Models in S by Chambers and Hastie. It is a little abstract for me. Could somebody point me some references that have more examples and more explanations that can help me understand the rules (in particular, the ones on pag

Re: [R] lm() notation question

2009-11-29 Thread Ista Zahn
The help page for lm says: "If ‘response’ is a matrix a linear model is fitted separately by least-squares to each column of the matrix." -Ista On Sun, Nov 29, 2009 at 11:46 AM, Carl Witthoft wrote: > Hi, > A recent thread provided a (working) construct for lm: > > lm(as.matrix(freeny[ix])

Re: [R] How to force regression coeffs for some values in a categorical variable

2009-11-29 Thread David Winsemius
On Nov 29, 2009, at 11:23 AM, sr danda wrote: Hi, I am a new R user. I am using it develop regression models with categorical variables. Is there a way to force some regression coefficients to be zero for some of the values in a categorical variable (with 12 factor levels)? I am recodin

Re: [R] lm() notation question

2009-11-29 Thread Carl Witthoft
As others helpfully pointed out, the meaning of "." in a formula is provided in the Details section of ?formula. (But NOT in ?lm) Ista Zahn wrote: The help page for lm says: "If ‘response’ is a matrix a linear model is fitted separately by least-squares to each column of the matrix." -I

Re: [R] column of dates into time series

2009-11-29 Thread DispersionMap
? like this do you mean... > dput(Weeks) structure(c(370L, 342L, 333L, 317L, 308L, 298L, 289L, 269L, 265L, 257L, 254L, 253L, 252L, 249L, 243L, 243L, 239L, 239L, 236L, 234L, 233L, 232L, 230L, 230L, 229L, 229L, 229L, 228L, 227L, 226L, 225L, 222L, 218L, 217L, 216L, 215L, 215L, 214L, 214L, 214L, 2

Re: [R] lm() notation question

2009-11-29 Thread David Winsemius
On Nov 29, 2009, at 11:46 AM, Carl Witthoft wrote: Hi, A recent thread provided a (working) construct for lm: lm(as.matrix(freeny[ix]) ~., freeny[-ix]) Can someone explain what is meant by the formula in that expression, that is, what does "mymatrix~." do? It doesn't say my matrix, it sa

[R] lm() notation question

2009-11-29 Thread Carl Witthoft
Hi, A recent thread provided a (working) construct for lm: lm(as.matrix(freeny[ix]) ~., freeny[-ix]) Can someone explain what is meant by the formula in that expression, that is, what does "mymatrix~." do? I couldn't find any such example in the lm() or formula() help pages. thanks Carl

Re: [R] Orphaned R Packages (maybe this is too inside baseball?)

2009-11-29 Thread Uwe Ligges
Jason Rupert wrote: How do the R "powers that be" handle packages that are orphaned from CRAN? > Recently, I was looking for a function either part of the base functionality or an add-on package that mimicked the "poly" functionality from Octave (http://n4.nabble.com/Re-R-function-that-duplic

Re: [R] Iteration idioms & laziness

2009-11-29 Thread Duncan Murdoch
On 27/11/2009 3:36 PM, Alexander Søndergaard wrote: Hi all, I'm new to R. Having a functional background, I was wondering what's the idiomatic way to iterate. It seems that for loops are the default given there's no tail-call optimization. I'm curious to know whether there is a way to transform

[R] How to force regression coeffs for some values in a categorical variable

2009-11-29 Thread sr danda
Hi, I am a new R user. I am using it develop regression models with categorical variables. Is there a way to force some regression coefficients to be zero for some of the values in a categorical variable (with 12 factor levels)? I am recoding the values to the default value (1st in the order of d

Re: [R] kernlab's ksvm method freeze

2009-11-29 Thread Uwe Ligges
I just tried ksvm(kernel="matrix", kernelMatrix, trainingDataYs, type="C-svc", cross=10, C=2) several times on both workspaces and both returned some results after a couple of seconds under the same versions (R version 2.10.0 and kernlab 0.9-9.) under Windows XP. There mist be something el

Re: [R] column of dates into time series

2009-11-29 Thread David Winsemius
How about a representation of the data that one could so something with? By that I mean either by the "dump" method described in the Posting Guide or by using dput: > ttt <- c(1,2) > dput(ttt) c(1, 2) > dump("ttt", stdout() ) ttt <- c(1, 2) Did you honestly expect anyone in their right mind

Re: [R] t-criterion calculation using means and SE

2009-11-29 Thread Uwe Ligges
Антон Морковин wrote: Dear all, is there any functions which allow to calculate Student t-criterion using means, their SE and sample size? I've seek for, but bulit-in t-criterion works only with initial sample... Not that I know, but then, you can easily calculate the t statistics in a

Re: [R] R 2.10 Line Type Issue...

2009-11-29 Thread Uwe Ligges
David B. Thompson, Ph.D., P.E., D.WRE, CFM wrote: Morning folks (at least here on the western side of the U.S.)... This morning I constructed a contour plot of some bivariate distributions I'm working with. When I attempted to add a second contour to the plot using a dashed line (lty=2), R

Re: [R] Iteration idioms & laziness

2009-11-29 Thread Uwe Ligges
Alexander Søndergaard wrote: Hi all, I'm new to R. Having a functional background, I was wondering what's the idiomatic way to iterate. It seems that for loops are the default given there's no tail-call optimization. I'm curious to know whether there is a way to transform the following toy sn

[R] KhmaladzeTest in quantreg

2009-11-29 Thread antonella.cann...@virgilio.it
Hi, I've implemented the KhmaladzeTest for my linear quantile regression model for the location-scale shift hypotesis as follow: >formula=r ~ div + pe + por >Ktest=KhmaladzeTest(formula,nullH="location-scale") > Ktest $nullH [1] "location-scale" $Tn [1] 2.125804 $THn div p

Re: [R] How to z-standardize for subgroups?

2009-11-29 Thread Jorge Ivan Velez
Hi Karsten, Let me assume your data is called d. If I understood what you are trying to do, the following might help: res <- apply(d, 2, tapply, d$group, scale) res See ?apply, ?tapply and ?scale for more information. HTH, Jorge On Sun, Nov 29, 2009 at 10:41 AM, Karsten Wolf <> wrote: > Hi f

Re: [R] column of dates into time series

2009-11-29 Thread DispersionMap
Thanks again David, Heres what happened: > Weeks<-summary(cut(data$Raised.Date, breaks="weeks")) > Weeks 2007-12-17 2009-01-05 2008-06-09 2008-12-08 2009-02-09 2008-12-01 370342333317308298 2008-05-12 2009-02-16 2007-01-22 2008-06-02 2007-01-29 20

[R] How to z-standardize for subgroups?

2009-11-29 Thread Karsten Wolf
Hi folks, I have a dataframe df.vars with the follwing structure: var1 var2 var3 group Group is a factor. Now I want to standardize the vars 1-3 (actually - there are many more) by class, so I define z.mean.sd <- function(data){ return.values <- (data - mean(data)) / (sd(dat

Re: [R] Plotting observed vs. Predicted values, change of symbols

2009-11-29 Thread David Winsemius
On Nov 29, 2009, at 10:09 AM, oscar linares wrote: > Dear David, > > You are correct, I had a bug, here it is fixed. Note the times vector. > > # Need upright in same plots (e.g., dashed line) > times <- seq(0,20, len=100) > par(cex.lab=1.2,cex.axis=1.3) > > par(mfrow=c(2,1)) > plot(c(datasu$conc

Re: [R] R on Large Data Sets (again)

2009-11-29 Thread Jason Morgan
On 2009.11.29 14:24:40, Prof Brian Ripley wrote: > >> Windows 64-bit can certainly handle large memory spaces, but unless > >> something has changed recently it my understanding Revolution > >> Computing's 64-bit is the only 64-bit version of R available for > >> Windows (due to the unavailability

Re: [R] Removing objects from a list based on nrow

2009-11-29 Thread Linlin Yan
Thank Jim! You are right. I didn't notice the case of none of rows match the condition. On Sun, Nov 29, 2009 at 10:10 PM, jim holtman wrote: > One thing to be careful of is if no dataframe have less than 3 rows: > >> df1<-data.frame(letter=c("A","B","C","D","E"),number=c(1,2,3,4,5)) >> df2<-data.

Re: [R] Plotting observed vs. Predicted values, change of symbols

2009-11-29 Thread David Winsemius
On Nov 29, 2009, at 8:51 AM, oscar linares wrote: Dear Wiz[R]ds, I am deeply grateful for the help from Duncan Murdoch, Gray Calhoun, and others. We are almost there. For whatever reason, I can't change the symbol from a circle to a triangle in the upright posture plots. Any ideas? I hav

Re: [R] R on Large Data Sets (again)

2009-11-29 Thread Prof Brian Ripley
On Sun, 29 Nov 2009, Jason Morgan wrote: On 2009.11.28 21:50:09, Daniel Nordlund wrote: - Is a Unix-like platform a better option than win-64? Again, would this solve my memory limitation problems? Possibly, but Win64 should provide plenty of memory (I believe Windows 7 Ultimate can use up to

Re: [R] Plotting observed vs. Predicted values, change of symbols

2009-11-29 Thread David Winsemius
On Nov 29, 2009, at 8:51 AM, oscar linares wrote: Dear Wiz[R]ds, I am deeply grateful for the help from Duncan Murdoch, Gray Calhoun, and others. We are almost there. For whatever reason, I can't change the symbol from a circle to a triangle in the upright posture plots. Any ideas? I h

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Gabor Grothendieck
By the way, if you really do want to create the formula anyways then: ix <- 1:2 left <- paste(names(freeny)[ix], collapse = ",") fo <- as.formula(paste("cbind(", left, ") ~ .")) lm(fo, freeny) or possibly replace last line with: eval(substitute(lm(fo, freeny)) which will cause th

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Matthieu Stigler
Gabor Grothendieck a écrit : Try this: ix <- 1:2 lm(as.matrix(freeny[ix]) ~., freeny[-ix]) clean and clever!!! Thanks a lot!! You really simplified the code!!! Just for curiosity, do you see why parse(eval)) was not working twice in same formula? thanks a lot!! Matthieu On Sun, Nov 29,

Re: [R] Removing objects from a list based on nrow

2009-11-29 Thread jim holtman
One thing to be careful of is if no dataframe have less than 3 rows: > df1<-data.frame(letter=c("A","B","C","D","E"),number=c(1,2,3,4,5)) > df2<-data.frame(letter=c("A","B"),number=c(1,2)) > df3<-data.frame(letter=c("A","B","C","D","E"),number=c(1,2,3,4,5)) > df4<-data.frame(letter=c("A","B","C","

Re: [R] R on Large Data Sets (again)

2009-11-29 Thread Uwe Ligges
Jason Morgan wrote: On 2009.11.28 21:50:09, Daniel Nordlund wrote: - Is a Unix-like platform a better option than win-64? Again, would this solve my memory limitation problems? Possibly, but Win64 should provide plenty of memory (I believe Windows 7 Ultimate can use up to 192 GB of memory). Y

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Gabor Grothendieck
Try this: ix <- 1:2 lm(as.matrix(freeny[ix]) ~., freeny[-ix]) On Sun, Nov 29, 2009 at 8:56 AM, Matthieu Stigler < matthieu.stig...@gmail.com> wrote: > Thanks for answering so fast!! > >> >> lm(freeny) >> > :-) > Ok that's working for the one equation case :-) Was example case... > > But now I

Re: [R] GMM estimation

2009-11-29 Thread Arne Henningsen
Hi Zi! On 11/28/09, Yi Du wrote: > I'd like to resort generalized methods of moment to estimate a regression > model but I can't understand the help file of gmm package. If the regression > model is y, the instrumental variable is x, how can I write the code? > > By the way, I use systemfit's 3sl

Re: [R] R on Large Data Sets (again)

2009-11-29 Thread Jason Morgan
On 2009.11.28 21:50:09, Daniel Nordlund wrote: > > > - Is a Unix-like platform a better option than win-64? Again, would > > > this solve my memory limitation problems? > > > > Possibly, but Win64 should provide plenty of memory (I believe Windows 7 > > Ultimate can use up to 192 GB of memory). Yo

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Matthieu Stigler
Thanks for answering so fast!! lm(freeny) :-) Ok that's working for the one equation case :-) Was example case... But now I want to have not only first column of freeny on the left but both first? And I don't know their names a priori... Thanks! On Sun, Nov 29, 2009 at 8:49 AM, Matthie

Re: [R] R on Large Data Sets (again)

2009-11-29 Thread Duncan Murdoch
On 28/11/2009 6:53 PM, Lars Bishop wrote: Dear R users, I’ve search the R site for help on this topic but it is hard to find a precise answer for my questions. Which are the best options to overcome the RAM memory limitation problems when using R on “large” data sets (such as 2 or 3 million rec

Re: [R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Gabor Grothendieck
Try this: lm(freeny) On Sun, Nov 29, 2009 at 8:49 AM, Matthieu Stigler < matthieu.stig...@gmail.com> wrote: > Hi > > My goal is to do a (multiple) regression, just knowing that my Y variables > will be the say k first variables of a matrix/data frame. I thought I should > do it with eval(pars

Re: [R] kernlab's ksvm method freeze

2009-11-29 Thread Heiko Strathmann
Hello again, the freeze seems to depend on the kernel matrix. With another kernel matrix of similiar size, gernerated with the same kernel, but on another dataset, there is no freeze. I have put a workspace with the working matrix and one with the freezing matrix online for testing (see old email

[R] Plotting observed vs. Predicted values, change of symbols

2009-11-29 Thread oscar linares
Dear Wiz[R]ds, I am deeply grateful for the help from Duncan Murdoch, Gray Calhoun, and others. We are almost there. For whatever reason, I can't change the symbol from a circle to a triangle in the upright posture plots. Any ideas? I have included the problem in full. # tritiated (3H)-Norepineph

[R] lm: eval(parse(text=)) works on one side y/x but not on both?

2009-11-29 Thread Matthieu Stigler
Hi My goal is to do a (multiple) regression, just knowing that my Y variables will be the say k first variables of a matrix/data frame. I thought I should do it with eval(parse)) but encounter a strange problem. See: lm(y~.-y, data=freeny) #that's what I want to do in the one equation case #P

Re: [R] column of dates into time series

2009-11-29 Thread David Winsemius
On Nov 29, 2009, at 7:52 AM, Linlin Yan wrote: There is no year() function. Maybe you can try format() instead. On Sun, Nov 29, 2009 at 8:44 PM, DispersionMap > wrote: i have a column of dates in this format: data[,"Raised.Date"] <- as.Date(data[,"Raised.Date"], "%d/%m/%Y"); data[1:10,"Rais

[R] kernlab's ksvm method freeze

2009-11-29 Thread Heiko Strathmann
Hello, I am using kernlab to do some binary classification on aminoacid strings. I am using a custom kernel, so i use the kernel="matrix" option of the ksvm method. My (normalized) kernel matrix is of size 1309*1309, my results vector has the same length. I am using C-svc. My kernlab call is s

Re: [R] column of dates into time series

2009-11-29 Thread Linlin Yan
There is no year() function. Maybe you can try format() instead. On Sun, Nov 29, 2009 at 8:44 PM, DispersionMap wrote: > > i have a column of dates in this format: > > data[,"Raised.Date"] <- as.Date(data[,"Raised.Date"], "%d/%m/%Y"); > data[1:10,"Raised.Date"] > [1] "2006-07-07" "2006-07-07" "20

[R] column of dates into time series

2009-11-29 Thread DispersionMap
i have a column of dates in this format: data[,"Raised.Date"] <- as.Date(data[,"Raised.Date"], "%d/%m/%Y"); data[1:10,"Raised.Date"] [1] "2006-07-07" "2006-07-07" "2006-04-03" "2006-04-03" "2006-04-03" "2006-04-03" "2006-04-03" "2006-04-03" "2006-04-03" "2006-04-03" I can turn them into months

Re: [R] calling R from sas

2009-11-29 Thread Peter Flom
Arnab Maity wrote > > > >I like to call R from SAS. Could you please help me? > There are two methods that I know of: 1) Phil Rack has written a program called A Bridge to R see: http://minequest.com/WordPress/?p=102 2) If you have SAS/IML licensed, you can link to R through IML studio. I

  1   2   >