Re: [R] what happened to the xlsReadWrite package

2009-06-25 Thread Prof Brian Ripley
On Fri, 26 Jun 2009, David Scott wrote: Andrew Yee wrote: A naive question: what happened to the xlsReadWrite package? http://cran.r-project.org/web/packages/xlsReadWrite/ It says that it was removed from the CRAN repository. Note that it was archived, not removed entirely. That is done wi

Re: [R] how to access Internet from within R?

2009-06-25 Thread Barry Rowlingson
On Fri, Jun 26, 2009 at 7:21 AM, Michael wrote: > Let's say I have some automation tasks where I have to fill a table > field on a webpage, and then submit it to the server, and then obtain > the returned value (a typical web query), how to do that in R? > The RCurl package will let you construct

[R] how to access Internet from within R?

2009-06-25 Thread Michael
Let's say I have some automation tasks where I have to fill a table field on a webpage, and then submit it to the server, and then obtain the returned value (a typical web query), how to do that in R? Thanks a lot! __ R-help@r-project.org mailing list h

[R] predicted values after fitting gamma2 function

2009-06-25 Thread Steven Matthew Anderson
Question: after fitting a gamma function to some data, how do I get predicted values? I'm a SAS programmer, I new R, and am having problems getting my brain to function with the concept of "object as class ...". The following is specifics of what I am doing: I'm trying to determine the pd

[R] panel.text and saving to pdf

2009-06-25 Thread Willem Vervoort
Dear all, I am not sure what I am doing wrong, but I have some unexplained behaviour when saving a lattice graph including text to a pdf file. The text seems to move around. It must have something to do with the way coordinates are set in devices other than jpg. Any suggestions would be helpfu

[R] select number of lags in ADF.test

2009-06-25 Thread Hongwei Dong
Hi, all, According to the ADF.test help,""Singf" removes the non-significant lags at the 10% level of significance until all the selected lags are significant." However, when I use "singf", it still give me the lags that are not significant at 10% level. Anyone knows why? Thanks. Harry

[R] code that will use two data sets which differ in size.

2009-06-25 Thread Arnold Akem
Hi all, This is a really basic question but I can't figure it out. I am trying to write a piece of code that will  use two datasets, z and m.. This code is meant to assign the mean of selected values in dataset m to a new column z$c in datset z but the rows and columns of the two data sets diffe

Re: [R] apply on xts

2009-06-25 Thread R_help Help
Thanks David for reading for me. Anyhow, is there better way to do looping on xts objects than using apply? Thanks again. adschai On Thu, Jun 25, 2009 at 12:39 AM, David Winsemius wrote: > > On Jun 24, 2009, at 9:26 PM, R_help Help wrote: > > Hi, >> >> I do not understand why after I called app

Re: [R] pass a vector to C++

2009-06-25 Thread Dirk Eddelbuettel
On 25 June 2009 at 17:39, Ivo Shterev wrote: | Does anyone know how to pass a vector of strings, for example "c("1", "2", | "3") to a C++ function? Should the input argument to the C++ function be | vector*? For the basic mechanics of making R and C/C++ talk, see the 'R Extensions' manual that c

[R] pass a vector to C++

2009-06-25 Thread Ivo Shterev
Hi, Does anyone know how to pass a vector of strings, for example "c("1", "2", "3") to a C++ function? Should the input argument to the C++ function be vector*? Thanks a lot! Ivo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

Re: [R] Placing text outside graph boundary

2009-06-25 Thread David Winsemius
On Jun 25, 2009, at 7:51 PM, Payam Minoofar wrote: Hello, Is possible to place a label on a multipanel figure outside the boundaries of any single one of the existing graphs in a panel? Specifically, I have a function that creates a panel with quartz() and then fills it with 6 graphs con

[R] A question about r anaysing microarry data!Thank you!

2009-06-25 Thread Li, Bo
Dear, Thank you for cheking the mail! I'm Bo, student in TTU, and had a problem in using r for analyzing microarry data. This is what I write in r: library(limma) argets <- readTargets(file="targets.txt") *targets.txt is a tab-delimited file with columns: "SlideNumber", "FileName", "Cy3", "

[R] Placing text outside graph boundary

2009-06-25 Thread Payam Minoofar
Hello, Is possible to place a label on a multipanel figure outside the boundaries of any single one of the existing graphs in a panel? Specifically, I have a function that creates a panel with quartz() and then fills it with 6 graphs consisting of exactly the same plot for 6 different groups.

[R] Calculating distance between spatial points

2009-06-25 Thread Tim Clark
Dear List, I am trying to determine the speed an animal is traveling on each leg of a track. My data is in longitude and latitude, so I am using the package rgdal to convert it into a spatial points data frame and transform it to UTM. I would then like to find the difference between successi

Re: [R] what happened to the xlsReadWrite package

2009-06-25 Thread David Scott
Andrew Yee wrote: A naive question: what happened to the xlsReadWrite package? http://cran.r-project.org/web/packages/xlsReadWrite/ It says that it was removed from the CRAN repository. Are there any plans for it be available again? Thanks, Andrew There was a problem with proprietary code.

Re: [R] Setting default plot size in Sweave

2009-06-25 Thread Marc Schwartz
On Jun 25, 2009, at 4:47 PM, Frank E Harrell Jr wrote: Dear Colleagues: I have used \SweaveOpts{prefix.string=plot, eps = FALSE, pdf = TRUE} \SweaveOpts{width=5, height=4} <>= plot(...) @ But the figure still has a width of 80% of the text width, the default set up by Sweave, which issues

Re: [R] How to avoid ifelse statement converting factor to character

2009-06-25 Thread Stavros Macrakis
On Thu, Jun 25, 2009 at 12:47 PM, Craig P. Pyrame wrote: > The man page Stavros quotes states that the class attribute of the result is > taken from 'test', which clearly is not the case: Actually, the behavior is documented pretty clearly: The mode of the answer will be coerced from logical

[R] Setting default plot size in Sweave

2009-06-25 Thread Frank E Harrell Jr
Dear Colleagues: I have used \SweaveOpts{prefix.string=plot, eps = FALSE, pdf = TRUE} \SweaveOpts{width=5, height=4} <>= plot(...) @ But the figure still has a width of 80% of the text width, the default set up by Sweave, which issues a LateX command in Sweave.sty of \setkeys{Gin}{.8\textwid

Re: [R] what happened to the xlsReadWrite package

2009-06-25 Thread Dieter Menne
Andrew Yee post.harvard.edu> writes: > A naive question: what happened to the xlsReadWrite package? > http://cran.r-project.org/web/packages/xlsReadWrite/ > > It says that it was removed from the CRAN repository. Are there any plans > for it be available again? Presumable removed because it w

[R] lme gives different results to SAS Proc Mixed

2009-06-25 Thread Metconnection
http://www.nabble.com/file/p24211204/repeated.csv repeated.csv Dear all, I'm currently trying to replicate some Proc Mixed results using lme() and have a curious result I can't explain. The dataset is a repeated measures example where patients (each on one of several treatments) are measured

[R] Converting S-plus project folders to R

2009-06-25 Thread dbosley
I have many S-plus project folders that I need to convert to R workspaces. For the smaller project folders (< 200MB), using "data.dump" with "oldStyle = T" and "data.restore" (in the foreign package) within R seems to work fine. However, I have several project folders that are quite large (~ 4GB).

[R] Calculating home ranges using mcp in adehabitat

2009-06-25 Thread Tom Mason
Hello, I've been trying to calculate home range sizes (for Icelandic geese!) using minimum convex polygons with the adehabitat package. I've tried to use the R code shown by demo(homerange) in adehabitat and when that didn't work I've fiddled around with it but to no avail...Below is the output o

Re: [R] change the height or scale of the y axis

2009-06-25 Thread legen
Hi, Dieter Menne, Thank you for your help. I tried "par(las=1,cex=0.5)", but it changed only the size of indices on the y axis in the second plot relative to the default. I really want to increase the height of y axis in order to show all the indices (x1, x2, ...). In the genetic study, we aften

Re: [R] change the height or scale of the y axis

2009-06-25 Thread legen
Hi, Jim, Thank you for your reply. I just want to increase the height of y axis in the second plot in order to show all the indices (x1, x2, ...). Can you help me? Thank you again. Legen Jim Lemon-2 wrote: > > legen wrote: >> Hallo, All, >> >> I have a question about changing the height or s

Re: [R] grid.polygon() + color gradient

2009-06-25 Thread baptiste auguie
Glad if it helps. check out this page of examples for tikz, http://www.texample.net/tikz/examples/feature/shadings/ If you do choose this route, you could perhaps read the new wiki page on importing graphics in a R plot, http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:display-ima

[R] what happened to the xlsReadWrite package

2009-06-25 Thread Andrew Yee
A naive question: what happened to the xlsReadWrite package? http://cran.r-project.org/web/packages/xlsReadWrite/ It says that it was removed from the CRAN repository. Are there any plans for it be available again? Thanks, Andrew [[alternative HTML version deleted]] __

Re: [R] (Resolved) How to draw a line in plot when I know the start point(x1, y1) and end point(x2, y2)?

2009-06-25 Thread lesandrop
Thanks Jorge and Marc, I drew the line using the function: segments(x0, y0, x1, y1) Lesandro --- Em qui, 25/6/09, Marc Schwartz escreveu: De: Marc Schwartz Assunto: Re: [R] How to draw a line in plot when I know the

Re: [R] How to draw a line in plot when I know the start point(x

2009-06-25 Thread Marc Schwartz
On Jun 25, 2009, at 1:51 PM, Ted Harding wrote: On 25-Jun-09 18:38:37, Marc Schwartz wrote: On Jun 25, 2009, at 1:30 PM, Lesandro wrote: Hello all, How to draw a line in plot when I know the start point(x1,y1) and end point(x2,y2)? I need make this as additional information in the graph: plo

[R] LaTeX references inside R code using SweaveListingUtils

2009-06-25 Thread Frank E Harrell Jr
I have sent a note to Peter Ruckdeschel who wrote the excellent SweaveListingUtils package but find myself up against a deadline in preparing a handout for useR! 2009. The following is supposed to work: <<>>= plot(x, y) # Figure `\ref{myfig}` @ Where the back tick ` is an escape character

Re: [R] How to draw a line in plot when I know the start point(x

2009-06-25 Thread Ted Harding
On 25-Jun-09 18:38:37, Marc Schwartz wrote: > On Jun 25, 2009, at 1:30 PM, Lesandro wrote: >> Hello all, >> How to draw a line in plot when I know the start point(x1,y1) >> and end point(x2,y2)? I need make this as additional information >> in the graph: >> >> plot(wl2[[1]],wl2[[2]]) >> >> I think

Re: [R] How to draw a line in plot when I know the start point(x1, y1) and end point(x2, y2)?

2009-06-25 Thread Marc Schwartz
On Jun 25, 2009, at 1:30 PM, Lesandro wrote: Hello all, How to draw a line in plot when I know the start point(x1,y1) and end point(x2,y2)? I need make this as additional information in the graph: plot(wl2[[1]],wl2[[2]]) I think that is possible make this with the function abline(), is

Re: [R] How to draw a line in plot when I know the start point(x1, y1) and end point(x2, y2)?

2009-06-25 Thread Jorge Ivan Velez
Dear Lesandro, Take a look at ?segments HTH, Jorge On Thu, Jun 25, 2009 at 2:30 PM, Lesandro wrote: > Hello all, > > How to draw a line in plot when I know the start point(x1,y1) and end > point(x2,y2)? I need make this as additional information in the graph: > > plot(wl2[[1]],wl2[[2]]) > >

[R] How to draw a line in plot when I know the start point(x1, y1) and end point(x2, y2)?

2009-06-25 Thread Lesandro
Hello all, How to draw a line in plot when I know the start point(x1,y1) and end point(x2,y2)? I need make this as additional information in the graph: plot(wl2[[1]],wl2[[2]]) I think that is possible make this with the function abline(), is possible? I looked the function lines() too, but don

Re: [R] interaction terms formula error

2009-06-25 Thread Frank E Harrell Jr
Alejandra Solis Herrera wrote: Hi, I'm trying to fit a binary logistic regression model, and would like to consider certain characteristics B and C only for people with variable A=1 and not for those with variable A=0, so I'm trying to do the following: model<- lrm(formula= y ~ A: (B

[R] interaction terms formula error

2009-06-25 Thread Alejandra Solis Herrera
Hi, I'm trying to fit a binary logistic regression model, and would like to consider certain characteristics B and C only for people with variable A=1 and not for those with variable A=0, so I'm trying to do the following: model<- lrm(formula= y ~ A: (B+C) + D + E +...) I've had no p

Re: [R] Software lifecycle for R releases (aka practical limits of support for older versions)

2009-06-25 Thread Marc Schwartz
On Jun 25, 2009, at 11:38 AM, Rowe, Brian Lee Yung (Portfolio Analytics) wrote: Hello useRs: Does anyone have thoughts on the lifecycle of older releases of R? I know that currently the 2.8.x and 2.9.x releases seem to be actively "supported" on the mailing lists, but what about older release

Re: [R] Software lifecycle for R releases (aka practical limits of support for older versions)

2009-06-25 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
Good to know. I know that other software projects (whether languages, OSes, applications) tend to keep recent versions in maintenance mode for a certain period of time prior to "retiring them". I wonder if that would happen with R, either by design or out of necessity of an increasing user base. B

Re: [R] Software lifecycle for R releases (aka practical limits of support for older versions)

2009-06-25 Thread David M Smith
On Thu, Jun 25, 2009 at 9:38 AM, Rowe, Brian Lee Yung (Portfolio Analytics) wrote: > Hello useRs: > > Does anyone have thoughts on the lifecycle of older releases of R? I > know that currently the 2.8.x and 2.9.x releases seem to be actively > "supported" on the mailing lists, but what about older

Re: [R] Software lifecycle for R releases (aka practical limits of support for older versions)

2009-06-25 Thread Thomas Lumley
On Thu, 25 Jun 2009, Rowe, Brian Lee Yung (Portfolio Analytics) wrote: Does anyone have thoughts on the lifecycle of older releases of R? I know that currently the 2.8.x and 2.9.x releases seem to be actively "supported" on the mailing lists, but what about older releases, say 2.4.x? Curious to

[R] Problems with help

2009-06-25 Thread Leandro Marino
Hi, I was trying to read some help of functions and in all functions I try to see is giving me this error: > ?write.table Erro em print.help_files_with_topic("C:/ARQUIV~1/R/R-29~1.0/library/utils/chm/write.table") : CHM file could not be displayed Anybody knows what is happening? Atenciosa

Re: [R] How to avoid ifelse statement converting factor to character

2009-06-25 Thread Craig P. Pyrame
Dear Rolf, Rolf Turner wrote: On 25/06/2009, at 12:27 PM, Craig P. Pyrame wrote: Dear Stavros, What you discuss below is somewhat scary to me as an R newbie. Is this just an incident, a bug perhaps, or rather the way things typically go in R, as your "Welcome to R!" seems to suggest? I ha

Re: [R] Software lifecycle for R releases (aka practical limits of support for older versions)

2009-06-25 Thread stephen sefick
There is an archive for all packages for older versions of R, but if you want up-to-date functionality of packages then you need the newest versions. my 2 cents stephen On Thu, Jun 25, 2009 at 12:38 PM, Rowe, Brian Lee Yung (Portfolio Analytics) wrote: > Hello useRs: > > Does anyone have thought

[R] Long memory residuals

2009-06-25 Thread Ana Ramos
Hi, How can I obtain the residuals of my long memory model: x.fd = fracdiff(dif, nar=1, nma=2, M=30) There is no function as acf() as for arima or garch models... Many thanks Ana [[alternative HTML version deleted]] __ R-help@r-project.org m

[R] Software lifecycle for R releases (aka practical limits of support for older versions)

2009-06-25 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
Hello useRs: Does anyone have thoughts on the lifecycle of older releases of R? I know that currently the 2.8.x and 2.9.x releases seem to be actively "supported" on the mailing lists, but what about older releases, say 2.4.x? Curious to hear when people think older versions of R become obsolete a

Re: [R] How to avoid ifelse statement converting factor to character

2009-06-25 Thread Stavros Macrakis
Erratum: >     ifelse(TRUE,dd,dd) => 1230786000 (class numeric) should be ifelse(TRUE,tt,tt) => 1230786000 (class numeric) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.

Re: [R] Error: system is computationally singular: reciprocal conditionnumber

2009-06-25 Thread Ravi Varadhan
Your covariance matrix Szz is not positive definite. It is singular. The following test that you are doing is neither necessary nor useful: zz.ev <- eigen(Szz)$values if(min(zz.ev)[1]<0){ stop("\'Szz\' is not positive definite!\n") } You may want to use Moore-Penrose inve

Re: [R] How to avoid ifelse statement converting factor to character

2009-06-25 Thread Stavros Macrakis
On Wed, Jun 24, 2009 at 9:04 PM, Rolf Turner wrote: >  Do not get your knickers in a twist.  R works simply and straightforwardly >  in simple straightforward situations. Though I find R an incredibly useful tool, alas, it is simply not true that "R works simply and straightforwardly in simple str

Re: [R] crr - computationally singular

2009-06-25 Thread Ravi Varadhan
This means that your design matrix or model matrix is rank deficient, i.e it does not have linearly independent columns. Your predictors are collinear! Just take your design matrices "covaea" or "covaeb" with 17 predcitors and compute their rank or try to invert them. You will see the problem.

Re: [R] Problems with subsets in NLME

2009-06-25 Thread apjaworski
Rebecca, I think the problem is that subset is a nume of an R function. If you do something like subs <- c(rep(TRUE, 107), FALSE) fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1, subset=subs) everything works fine. Hope this helps, Andy __ An

Re: [R] Problems with subsets in NLME

2009-06-25 Thread David Winsemius
On Jun 25, 2009, at 11:35 AM, Rebecca Sela wrote: I am trying to estimate models with subsets using the NLME package. However, I am getting an error in the case below (among others): subset <- c(rep(TRUE, 107), FALSE) fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1, subset=

[R] crr - computationally singular

2009-06-25 Thread Laura Bonnett
Dear R-help, I'm very sorry to ask 2 questions in a week. I am using the package 'crr' and it does exactly what I need it to when I use the dataset a. However, when I use dataset b I get the following error message: Error in drop(.Call("La_dgesv", a, as.matrix(b), tol, PACKAGE = "base")) : syst

[R] Problems with subsets in NLME

2009-06-25 Thread Rebecca Sela
I am trying to estimate models with subsets using the NLME package. However, I am getting an error in the case below (among others): > subset <- c(rep(TRUE, 107), FALSE) > fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1, > subset=subset) Error in xj[i] : invalid subscript type 'c

Re: [R] Efficient lookup on a two-dimensional table

2009-06-25 Thread Rama Ramakrishnan
Thanks, Gabor. Works great! On Thu, Jun 25, 2009 at 10:38 AM, Gabor Grothendieck < ggrothendi...@gmail.com> wrote: > Try this (shown for stated problem but generalizes by just adding > additional arguments): > > mapply("[", list(x), ltrs, mnths) > > > On Thu, Jun 25, 2009 at 10:24 AM, Rama Ramak

[R] How do I define the method for gcheckboxgroup in gWidgets?

2009-06-25 Thread Bryan Hanson
Hi All... I¹m trying to build a small demo using gWidgets which permits interactive scaling and selection among different things to plot. I can get the widgets for scaling to work just fine. I am using gcheckboxgroup to make the (possibly multiple) selections. However, I can¹t seem to figure ou

Re: [R] exportation of xml file from R

2009-06-25 Thread Duncan Temple Lang
BTW, the XML you show is not legal XML. For instance, the element F)>NAF)> is not a legal XML element name. Similarly is not a legal name since it is "2". And anova:2 means an element with name 2 with (XML) name space prefix "anova" (which must be declared previously) As Gabor mentioned

[R] [R-pkgs] WriteXLS - New Version 1.8.1

2009-06-25 Thread Marc Schwartz
The updated package has been submitted to CRAN and will propagate to mirrors over the next day or so. It is maintained on R-Forge at http://r-forge.r-project.org/projects/writexls , where downloads will be available as well. There is a transient problem at the moment with R-Forge and the bui

Re: [R] Efficient lookup on a two-dimensional table

2009-06-25 Thread Rama Ramakrishnan
Thanks, David, that works too! On Thu, Jun 25, 2009 at 10:30 AM, David Winsemius wrote: > > On Jun 25, 2009, at 10:24 AM, Rama Ramakrishnan wrote: > > Follow-on question: is there a way to do this for higher-dimensional (i.e. >> more than 2 dimensions) arrays? >> > > The apply method I just pos

Re: [R] exportation of xml file from R

2009-06-25 Thread Duncan Temple Lang
Hi Guillaume Once you have created an XML representation using any of the various ways to represent XML in R via the XML package (e.g. internal nodes, lists of lists, hash trees), you can use the saveXML() function: saveXML(myXML, "fileName.xml") Personally, I use newXMLNode() and friend

Re: [R] exportation of xml file from R

2009-06-25 Thread Gabor Grothendieck
See the StatDataML package. On Thu, Jun 25, 2009 at 10:54 AM, guillaume Le Ray wrote: > Hello everybody, > > I have programed a function to translate the R object structure into a XML > data structure but I haven't found a function in the XML package to export > this data in an XML file! > > my da

[R] Error: system is computationally singular: reciprocal condition number

2009-06-25 Thread Moumita Das
I get this error while computing partial correlation. *Error in solve.default(Szz) : system is computationally singular: reciprocal condition number = 4.90109e-18* Why is it?Can anyone give me some idea ,how do i get rid it it? This is the function i use for calculating partial correlation.

[R] exportation of xml file from R

2009-06-25 Thread guillaume Le Ray
Hello everybody, I have programed a function to translate the R object structure into a XML data structure but I haven't found a function in the XML package to export this data in an XML file! my data look like that: Assessor:codec 33.98159 28 6.510894 F)> 1.725149e-22F)>

Re: [R] Efficient lookup on a two-dimensional table

2009-06-25 Thread Gabor Grothendieck
Try this (shown for stated problem but generalizes by just adding additional arguments): mapply("[", list(x), ltrs, mnths) On Thu, Jun 25, 2009 at 10:24 AM, Rama Ramakrishnan wrote: > Follow-on question: is there a way to do this for higher-dimensional (i.e. > more than 2 dimensions) arrays? > >

[R] Make functions aware of theyr own slots.

2009-06-25 Thread Vitalie S.
Hello, Is there a way to access function's slots from inside the function? I want to make functions slot dependent without recurring to generic function mechanism. Probably this goes a bit against R philosophy, but otherwise I don't really see the use of extending functions in R. Would

Re: [R] Efficient lookup on a two-dimensional table

2009-06-25 Thread David Winsemius
On Jun 25, 2009, at 10:24 AM, Rama Ramakrishnan wrote: Follow-on question: is there a way to do this for higher-dimensional (i.e. more than 2 dimensions) arrays? The apply method I just posted generalizes to higher dimensional arrays. -- DW On Thu, Jun 25, 2009 at 10:17 AM, Rama Ramakr

Re: [R] RODBC: Trying to read an Excel file

2009-06-25 Thread Duncan Murdoch
On 6/25/2009 7:20 AM, John Sorkin wrote: R 2.8 Windows XP Excel 2003 I am trying to read an Excel spread sheet. I have looked at the RODBC help pages and am having trouble setting up code that will work. My code and the results are pasted below: jo<-odbcConnectExcel("i:\\all\\sorkinjohn\\st

Re: [R] Efficient lookup on a two-dimensional table

2009-06-25 Thread David Winsemius
On Jun 25, 2009, at 10:02 AM, Rama Ramakrishnan wrote: Dear R-Users, I need to lookup values from a 2-d table using the row names and column names as indices. I was wondering if there's a way to do this without an explicit loop. Example: #x is the 2-d table that holds the values x <- mat

Re: [R] Efficient lookup on a two-dimensional table

2009-06-25 Thread Rama Ramakrishnan
Follow-on question: is there a way to do this for higher-dimensional (i.e. more than 2 dimensions) arrays? On Thu, Jun 25, 2009 at 10:17 AM, Rama Ramakrishnan wrote: > That works!! Very nice way to do it! Thank you, Henrique! > Rama Ramakrishnan > > > On Thu, Jun 25, 2009 at 10:11 AM, Henrique D

[R] [e1071] Inconsistent results when using matrix.csr for svm() - possibly scaling problem

2009-06-25 Thread Eva May
Dear all, I'm training an SVM with default settings on a matrix csr (SparseM package). I realized that if I train the SVM with the (hopefully) equivalent matrix (Matrix package) representation, the returned models and predictions sometimes differ. I expected both representations of the same dat

Re: [R] Efficient lookup on a two-dimensional table

2009-06-25 Thread Henrique Dallazuanna
Try this: y$values <- diag(x[y$ltrs, y$mnths]) On Thu, Jun 25, 2009 at 11:02 AM, Rama Ramakrishnan wrote: > Dear R-Users, > I need to lookup values from a 2-d table using the row names and column > names as indices. I was wondering if there's a way to do this without an > explicit loop. > > Exam

Re: [R] Efficient lookup on a two-dimensional table

2009-06-25 Thread Rama Ramakrishnan
That works!! Very nice way to do it! Thank you, Henrique! Rama Ramakrishnan On Thu, Jun 25, 2009 at 10:11 AM, Henrique Dallazuanna wrote: > Try this: > > y$values <- diag(x[y$ltrs, y$mnths]) > > On Thu, Jun 25, 2009 at 11:02 AM, Rama Ramakrishnan wrote: > >> Dear R-Users, >> I need to lookup valu

[R] Fwd: Efficient lookup on a two-dimensional table

2009-06-25 Thread Rama Ramakrishnan
Resending after fixing a mistake in the earlier email ... sorry for the confusion. ** Dear R-Users, I need to lookup values from a 2-d table using the row names and column names as indices. I was wondering if there's a way to do this without an explicit loop. Example: #x is the 2-d table that

[R] Efficient lookup on a two-dimensional table

2009-06-25 Thread Rama Ramakrishnan
Dear R-Users, I need to lookup values from a 2-d table using the row names and column names as indices. I was wondering if there's a way to do this without an explicit loop. Example: #x is the 2-d table that holds the values x <- matrix(rnorm(26*12),nrow=26) rownames(x) <- letters colnames(x) <

Re: [R] get a dataframe subset based on time interval

2009-06-25 Thread Gabor Grothendieck
Try this: DF <- data.frame(tt = ISOdate(2009, 1:12, 1), x = 1:12, y = 1:12) st <- as.POSIXct("2009-05-01 00:00:00") en <- as.POSIXct("2009-07-01 23:59:59") DF[DF$tt > st & DF$tt < en, ] If the data in DF is numeric you would probably be better off using a zoo series than a data.frame in which cas

Re: [R] ANOVA with means and SDs as input

2009-06-25 Thread Richard M. Heiberger
Look at the anova.mean function in the HH package. It does what you are asking, although limited to one-way ANOVA. __ 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.or

[R] get a dataframe subset based on time interval

2009-06-25 Thread Paulo E. Cardoso
Hi, I have a big dataframe with a POSIXct column and I'd like to extract a subset contained in a given time interval, from Date 1 to Date 2. Paulo E. Cardoso __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Using by() and stacking back sub-data frames to one data frame

2009-06-25 Thread David Winsemius
Your request for a more general approach is precisely the reason that Hadley Wickham wrote the plyr package. He describes a split-apply- combine strategy for a variety of data structures and tools to implement those strategies here: http://had.co.nz/plyr/plyr-intro-090510.pdf The argument t

Re: [R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Rainer M Krug
On Thu, Jun 25, 2009 at 2:55 PM, Gabor Grothendieck wrote: > It works for me. Try a more recent version of R. Good to see that it is fixed in 2.9.1. I am using the latest release and am going to wait till 2.9.1 is released. Thanks, Rainer > > > a <- c("PR", "NC", "A2", "BS") > > b <- c(1,

Re: [R] Using by() and stacking back sub-data frames to one data frame

2009-06-25 Thread hadley wickham
Have a look at ddply from the plyr package, http://had.co.nz/plyr. It's made for exactly this type of operation. Hadley On Wed, Jun 24, 2009 at 10:34 PM, Stephan Lindner wrote: > Dear all, > > > I have a code where I subset a data frame to match entries within > levels of an factor (actually, the

Re: [R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Gabor Grothendieck
It works for me. Try a more recent version of R. > a <- c("PR", "NC", "A2", "BS") > b <- c(1, 0.5, 0.25, 0.125, 0.0625, 0.03125) > > class(expand.grid(a, b, stringsAsFactors=FALSE)[[1]]) [1] "character" > class(expand.grid(a, b, stringsAsFactors=TRUE)[[1]]) [1] "factor" > R.version.string [1] "R

Re: [R] GeoXp package

2009-06-25 Thread epoizot
Zeljko Vrba wrote: > > On Wed, Jun 10, 2009 at 08:21:06AM +0200, Poizot Emmanuel wrote: >> Error in fun(...) : >>GDAL Error 1: libgrass_I.so: Ne peut ouvrir le fichier d'objet >> partagé: Aucun fichier ou dossier de ce type (sorry for the french :) ) >> > > It would have been far more

Re: [R] variable driven summary of one column

2009-06-25 Thread Chuck Cleland
On 6/25/2009 5:44 AM, Anne Skoeries wrote: > Hello, > > how can I get a variable driven summary of one column of my data.frame? > > Usually I would do >> summary(data$columnname) to get a summary of column named "columnname" > of my data.frame named "data". > > In my case the columnname is not s

Re: [R] Coxph frailty model counting process error X matrix deemed singular

2009-06-25 Thread Terry Therneau
... > Occasionally, (about 1 in every 100 simulations) I get the following warning: > Error in coxph(Surv(start, end, censorind) ~ binary + uniform : > X matrix deemed to be singular; variable 2 It is not uncommon for the X matrix in a Cox model to be close enough to singular that the p

Re: [R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Rainer M Krug
On Thu, Jun 25, 2009 at 1:38 PM, Henrique Dallazuanna wrote: > I also not find this in the source code, but you can rewrite the function > with this: > That's true - but this should be fixed in the package itself. I have just converted the factor to characters. Cheers Rainer > > expand.grid <

Re: [R] lm

2009-06-25 Thread Jorge Ivan Velez
Dear Oscar, Try this: # Some data set.seed(123) a <- matrix(rnorm(100*200), ncol = 200) b <- matrix(rnorm(100*200), ncol = 200) # Auxiliar function to extract the coefficient # after fitting models without intercept mycoef <- function(x, y) coefficients( lm(y ~ x - 1) ) # Results res <- sapply(1

Re: [R] Apply as.factor (or as.numeric etc) to multiple columns

2009-06-25 Thread SIES 73
Very good points :-) > - colClasses() in R.utils is similar, except for the particular codes and > classes supported, to expandClasses() here. In fact I saw colClasses() once and got the idea from it, but when I needed the functionallity I did not remember where had I seen it and rewrote it. N

Re: [R] change the height or scale of the y axis

2009-06-25 Thread Jim Lemon
legen wrote: Hallo, All, I have a question about changing the height or scale of the y axis. When I use following two R codes, I can get two plots. Please look at the y axes, the number of indices (x1, x2, …) on the y axis in the first plot is smaller than that in the second plot, and hence the

Re: [R] RODBC: Trying to read an Excel file

2009-06-25 Thread Rodrigo Aluizio
Try the function sqlFetch to import the data in the spreadsheet. jo<-odbcConnectExcel("i:\\all\\sorkinjohn\\stats\\silvermannatalie\\NEMOcomb ined06-24-09.xls",readOnly = TRUE) mo<-sqlFetch(jo,'Your Sheet Name or Number',colnames=F,rownames=F) mo Hope it helps. -

[R] get, put, post implementation

2009-06-25 Thread Thomas . Bock
Dear List, I'm searching for a way (package, function or something) providing the http PUT, GET POST ... methods in R. httpRequest and RCurl seems to have a lack of the PUT method. Regards Thomas || Thomas Bock c/o Physikalisch-Technische Bundesanstalt || Abbestr. 2-12, D-10587 Berlin, Germany

Re: [R] RODBC: Trying to read an Excel file

2009-06-25 Thread Jorge Ivan Velez
Dear John, Try this: require(RODBC) spreadsheet <- "Sheet1" # please change this to your needs channel <- odbcConnectExcel("i:\\all\\sorkinjohn\\stats\\silvermannatalie\\NEMOcombined06-24-09.xls") mydata <- sqlFetch(channel, spreadsheet) odbcClose(channel) # attach(mydata) mydata HTH, Jorge O

Re: [R] Apply as.factor (or as.numeric etc) to multiple columns

2009-06-25 Thread Gabor Grothendieck
That's quite nice. Three comments: - colClasses() in R.utils is similar, except for the particular codes and classes supported, to expandClasses() here. - not sure if this is important but if as() were the last possibility tried rather than the first then in most cases (in fact all cases handle

Re: [R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Henrique Dallazuanna
I also not find this in the source code, but you can rewrite the function with this: expand.grid <- function (..., KEEP.OUT.ATTRS = TRUE, stringsAsFactors = FALSE) { nargs <- length(args <- list(...)) if (!nargs) return(as.data.frame(list())) if (nargs == 1L && is.list(a1 <- ar

Re: [R] Using by() and stacking back sub-data frames to one data frame

2009-06-25 Thread jim holtman
One thing you might consider when working with large dataframes is that instead of partitioning the dataframe into smaller ones, create a list of indices and use that to access the subset. Works especially well when using 'lapply' to cromp through many segments of a data frame: > y suid mon

Re: [R] variable driven summary of one column

2009-06-25 Thread Henrique Dallazuanna
Try: data[,variable] On Thu, Jun 25, 2009 at 6:44 AM, Anne Skoeries wrote: > Hello, > > how can I get a variable driven summary of one column of my data.frame? > > Usually I would do > > summary(data$columnname) to get a summary of column named "columnname" of > my data.frame named "data". > > I

Re: [R] List subsetting

2009-06-25 Thread Henrique Dallazuanna
Another options is: head(lapply(a, tail, 2), 2) On Wed, Jun 24, 2009 at 8:42 PM, Ivo Shterev wrote: > > Hello, > > I have a question about list indexing. Lets say we have a list of 3 lists, > each containing 3 different type elements: > > > a=replicate(3, list(list(c(1,1,1), diag(3), c(2,2,2)))

[R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Rainer M Krug
Hi I have the feeling, that the argument stringsAsFactors has no impact in the function expand.grid: a <- c("PR", "NC", "A2", "BS") b <- c(1, 0.5, 0.25, 0.125, 0.0625, 0.03125) class(expand.grid(css, fscs, stringsAsFactors=FALSE)[[1]]) [1] "factor" class(expand.grid(css, fscs, stringsAsFactors=T

[R] variable driven summary of one column

2009-06-25 Thread Anne Skoeries
Hello, how can I get a variable driven summary of one column of my data.frame? Usually I would do > summary(data$columnname) to get a summary of column named "columnname" of my data.frame named "data". In my case the columnname is not static but can be set dynamically. So I save the chosen c

[R] RODBC: Trying to read an Excel file

2009-06-25 Thread John Sorkin
R 2.8 Windows XP Excel 2003 I am trying to read an Excel spread sheet. I have looked at the RODBC help pages and am having trouble setting up code that will work. My code and the results are pasted below: > jo<-odbcConnectExcel("i:\\all\\sorkinjohn\\stats\\silvermannatalie\\NEMOcombined06-24-0

[R] Removed from email list

2009-06-25 Thread Whoriskey, Sophie
Hi, Could I please be removed from the email list! Thank you, Sophie [[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

[R] normalization in wavelet analysis

2009-06-25 Thread Irina Foss
Dear, I am using wavelet function from library(dplR), I would like to have a normalised spectrum as an output (power relative to white noise). I was wondering if anyone can help me with that. Thank you. irina __ R-help@r-project.org mailing list http

Re: [R] ANOVA with means and SDs as input

2009-06-25 Thread Ted Harding
On 25-Jun-09 10:15:30, Sebastian Stegmann wrote: > Dear R-community, > I'm struggling with a paper that reports only fragmented results > of a 2by2by3 experimental design. However, Means and SDs for all > cells are given. > > Does anyone know a package/function that helps computing an ANOVA > with

  1   2   >