Re: [R] curvedarrow (some graphics problem)

2009-06-25 Thread casperyc
Hi there, This is now the code % library(grid) vp - viewport( x = unit(0, npc), y = unit(0, npc), just = c(left, bottom), xscale = c(-1, 1) , yscale = c(-1, 1)) vp2 - viewport( # probably not needed but I had trouble placing the xaxis x = unit(0,npc), y = unit(0.5, npc), just =

Re: [R] List subsetting

2009-06-25 Thread Dieter Menne
Ivo Shterev wrote: I have a question about list indexing. Lets say we have a list of 3 lists, each containing 3 different type elements: (Details of your nice example code removed) a=replicate(3, list(list(c(1,1,1), diag(3), c(2,2,2 str(a) # I prefer this to print(a) because

Re: [R] adf.test Vs ADF.test...

2009-06-25 Thread DongHongwei
Hi, R users, I'm using R to test the unit root for my time series data. I just compared the ADF.test in uroot package and the adf.test in tseries package. It seems it is difficult to define the time trend and intercept in adf.test. But it is easy to do these in ADF.test. ADF.test also help

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

2009-06-25 Thread Dieter Menne
legen wrote: 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] Apply as.factor (or as.numeric etc) to multiple columns

2009-06-25 Thread SIES 73
Hi Mark, I frequently need to do that when importing data. This one-liner works: data.frame(mapply(as, x, c(integer, character, factor), SIMPLIFY=FALSE), stringsAsFactors=FALSE); but it has two problems: 1) as() is an S4 method that does not always work 2) writting the vector of classes

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

2009-06-25 Thread Patrick Burns
This sort of experience is why 'The R Inferno' came into existence. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) Craig P. Pyrame wrote: Dear Stavros, What you discuss below is somewhat scary

[R] error: compiling R package

2009-06-25 Thread Stein, Luba (AIM SE)
Hello, I tried to build an own R package on Windows XP but get an error which I can't solve. I called my package pack. It works to creat the file pack with package.skeleton(). But when I try to compile it with Rcmd build --binary pack I obtain the following error: IO::Seekable::seek missing

Re: [R] Lose of decimal when using write.table to text file

2009-06-25 Thread Dieter Menne
Bob Ly robertly at vfemail.net writes: I have the following: Date-c(08/05/08,08/06/08,08/07/08) Weight-c(209.4,211.8,210.0) planned.meal-cbind(Date,Weight) planned.meal DateWeight 1 08/05/08, 209.4 2 08/06/08, 211.8 3 08/07/08, 210.0 This is strange. When I run your

Re: [R] error: compiling R package

2009-06-25 Thread Prof Brian Ripley
On Thu, 25 Jun 2009, Stein, Luba (AIM SE) wrote: Hello, I tried to build an own R package on Windows XP but get an error which I can't solve. I called my package pack. It works to creat the file pack with package.skeleton(). But when I try to compile it with Rcmd build --binary pack I

Re: [R] curvedarrow (some graphics problem)

2009-06-25 Thread baptiste auguie
This will give you a greek character, see ?plotmath grid.text(expression(mu*(s,t)), 0.5, unit(5, lines), vp=vp2) The following works for me, it may be that you're using an outdated version of R, vp - viewport( x = unit(0, npc), y = unit(0, npc), just = c(left, bottom), xscale = c(-1, 1) ,

[R] JRI - problem to access stats package

2009-06-25 Thread GRAN
Hello, I am a new R user. More precisely, I am working with JRI (on a Eclipse Java6 project under Ubuntu9). I have difficulties to access some R packages (For example: package stats, object Normal, function pnorm). I have tried many solutions to set the right path but nothing have succeed:

[R] [R-pkgs] RODBC 1.2-6 on CRAN, future directions

2009-06-25 Thread Prof Brian Ripley
Version 1.2.6 of RODBC is now on CRAN. This has a number of bug fixes and many workarounds for ODBC driver quirks--I've set up further testbeds for SQL Server 2008, Oracle and DB2. More visibly, the documentation has been expanded in several ways, in particular in collecting together advice

Re: [R] JRI - problem to access stats package

2009-06-25 Thread Geoff Gibbs
Hi Antoine, I have got this to work on Windows, the process should be the same for Linux. For an eclipse plugin you will need to add the following to your MANIFEST.MF file: Bundle-ClassPath: whatever you normally have, lib/JRI.jar Bundle-NativeCode: /lib/jri.dll; osname=winxp; processor=x86

Re: [R] adf.test Vs ADF.test...

2009-06-25 Thread Pfaff, Bernhard Dr.
Dear Harry, to complete the picture, for the packages installed on my machine help.search() yielded: help.search(Dickey) Help files with alias or concept or title matching 'Dickey' using fuzzy matching: CADFtest::CADFtest Hansen's Covariate-Augmented Dickey Fuller

[R] random sampling or random replacement

2009-06-25 Thread Joanne Demmler
Dear R users, I'm trying to randomly recreate a real dataset with missing data and I'm not quite sure if I can use the sample command for this. I think it might be better to do it in 2 steps and randomly replace the sampled data with missing data... So something like this x -

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

2009-06-25 Thread baptiste auguie
Hi, I don't think the fill parameter can be a colour gradient. You'll need to create small polygons, each with its own fill (200, say). Try this, x= c(0, 0.5, 1) y= c(0.5, 1, 0.5) grid.polygon(x=x, y=y, gp=gpar(fill=grey90, col=grey90)) xx - seq(range(x)[1],range(x)[2], length=100) yy -

[R] lm

2009-06-25 Thread Oscar Bayona
Hi all, I want to make multiple least squares estimation on two matrix (without intercept) imagine matrix a and matrix b, I want to regress each colum on matrix a (dependent variable) on each column of matrix b, I mean, regress first colum on a to first column on b. Second column on a to second

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

2009-06-25 Thread baptiste auguie
[I neglected to check some details in the previous post] This one should work better, library(grid) x= c(0, 0.5, 1) y= c(0.5, 1, 0.5) grid.polygon(x=x, y=y, gp=gpar(fill=NA, col=grey90)) # outer shell xx - seq(range(x)[1],range(x)[2], length=100) dx - diff(xx) # width of clipped triangles

[R] ANOVA with means and SDs as input

2009-06-25 Thread Sebastian Stegmann
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 only Means and SDs as input (resulting in some sort of

Re: [R] random sampling or random replacement

2009-06-25 Thread Paul Chatfield
If you want to average 20% missing values then you could try it in 1 step, viz: sample(c(1:2, rep(NA, 2000)),100) Otherwise, 2 steps is preferable. Use code as below: sample(1:2,100)-kk kk[sample(1:100,20)]-NA Paul -- View this message in context:

Re: [R] random sampling or random replacement

2009-06-25 Thread Girish A.R.
Joanne, [...snip...] x - sample(1:2, 100) #without replacement Now I want x to contain to 20% missing data (NA). Could anyone help me how to do this? See if this helps: n - length(x) x[sample(n, 0.2*n)] - NA cheers, -Girish -- View this message

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 only

[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

[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

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

[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

[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=TRUE)[[1]])

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 idc...@yahoo.com 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),

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 h...@anne-skoeries.dewrote: 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

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

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 -

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

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 On Thu,

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

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.

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] 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.

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 -

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 www...@gmail.comwrote: 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

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

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 static but can

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 useful had

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 version 2.9.1 RC

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 Lindnerlindn...@umich.edu wrote: Dear all, I have a code where I subset a data frame to match entries within levels of an factor

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 ggrothendi...@gmail.com 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)

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

[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

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

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

[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

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 www...@gmail.comwrote: Try this: y$values - diag(x[y$ltrs, y$mnths]) On Thu, Jun 25, 2009 at 11:02 AM, Rama Ramakrishnan r...@alum.mit.eduwrote: Dear R-Users,

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 r...@alum.mit.eduwrote: 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

[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

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 r...@alum.mit.eduwrote: That works!! Very nice way to do it! Thank you, Henrique! Rama Ramakrishnan On Thu, Jun 25, 2009 at 10:11

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 -

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:

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

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

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 Ramakrishnanr...@alum.mit.edu wrote: Follow-on question: is there a way to do this for higher-dimensional (i.e. more than 2

[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: FactorAssessor:codec/Factor Sum Sq 33.98159/Sum Sq Df 28/Df F

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

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 Rayleray.guilla...@gmail.com 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

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 friends

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 dwinsem...@comcast.netwrote: 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

[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

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 Pr(F)NA/Pr(F) is not a legal XML element name. Similarly /anova:2 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

[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

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

[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

[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)) : system

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,

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 __

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] 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 Turnerr.tur...@auckland.ac.nz 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

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

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

[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

[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

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

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

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)b_r...@ml.com 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

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)b_r...@ml.com wrote: Hello useRs: Does anyone

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

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.

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

[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

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:

[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

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 lesand...@yahoo.com.br 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:

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(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 that is possible

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

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:

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 marc_schwa...@me.com escreveu: De: Marc Schwartz marc_schwa...@me.com Assunto: Re: [R]

[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] 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,

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 scale of

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

[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

[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). When

  1   2   >