Re: [R] Fastest Way to Divide Elements of Row With Its RowSum

2009-09-17 Thread William Revelle
At 2:40 PM +0900 9/17/09, Gundala Viswanath wrote: I have a data frame (dat). What I want to do is for each row, divide each row with the sum of its row. The number of row can be large 1million. Is there a faster way than doing it this way? datnorm; for (rw in 1:length(dat)) { tmp -

[R] boxplot

2009-09-17 Thread Sukhbir Rattan
Hi, I m not able to plot normalized data(normalization by rma) using boxplot. I don't know why? basically, object(formed of normalized data) belong to ExpressionSet class. It is showing error Error in x[!xna] : object of type 'S4' is not subsettable In addition: Warning messages: 1: In is.na(x)

[R] inline error message

2009-09-17 Thread _
Hi all, I installed the library inline to my default R-enviroment (c:\Programme\R.. ) downloaded and installed RTools from http://www.murdoch-sutherland.com/Rtools/ to c:\Rtools. Path variable is set right (with respect to order) but I get still the error message from my R Error in

[R] Filling Empty Column with String in read.table

2009-09-17 Thread Gundala Viswanath
I have a data file that looks like this. __DATA__ D7KAR5Z02F447V 176 G 0.22 D7KAR5Z02J3WLG 94 A 1.0529 D7KAR5Z02F4K6L 198 a 0.13 D7KAR5Z02J4SYO 67 C 0.9528 D7KAR5Z02J4SYO 83 C 1.0129 D7KAR5Z02J4SYO 97 T 0.13 D7KAR5Z02J4SYO 166 A 0.9427 I want the rows

Re: [R] rJava .jinit() : Cannot create Java virtual machine (-1)

2009-09-17 Thread Romain Francois
On 09/17/2009 07:30 AM, _ wrote: Hi all, when using .jinit() I get the message .jinit() : Cannot create Java virtual machine (-1). You probably also need to set JAVA_HOME to that location, and have the bin directory (the one that contains java.exe) in your PATH as well. Usually, support

[R] latex code in R - convert to pdf

2009-09-17 Thread Martin Batholdy
hi, is it possible to convert latex code to pdf in R (like a latex-program would do it)? Is there a package that comes with this capabilities? My problem is that I want to generate tables automatically - and I can't use a latex editor at that computer ... Besides latex ... are there

Re: [R] How to do rotation for polygon?

2009-09-17 Thread Hemavathi Ramulu
hi everyone, Its really helped, it almost as what I wanted. Thanks alot. On Sat, Sep 12, 2009 at 4:30 AM, Greg Snow greg.s...@imail.org wrote: Does this do what you want? library(TeachingDemos) ms.pent - function(ang=0,...) { theta - seq(ang, length.out=6, by=2*pi/5)

[R] R functions with array arguments

2009-09-17 Thread Maurizio Paolillo
Dear R users, I'm trying to implement a self-defined function with multiple arguments, one of which is an array, but I find that the result is a single value instead of an array. This is the example I'm working on: # define integration limit vector Mabslim - c(-17.95, -16.65, -17.27,

Re: [R] latex code in R - convert to pdf

2009-09-17 Thread Philipp Pagel
is it possible to convert latex code to pdf in R (like a latex-program would do it)? Is there a package that comes with this capabilities? My problem is that I want to generate tables automatically - and I can't use a latex editor at that computer ... Besides latex ... are there

[R] Turning points in a series

2009-09-17 Thread ogbos okike
Good morning once more. My problem of yesterday has been addressed. Having learned a few tricks from that, I wish to ask another question in connection with that. My data is a cosmic ray data consisting of dates and counts. When I plot a graph of counts versus dates, the resultant signal shows a

Re: [R] latex code in R - convert to pdf

2009-09-17 Thread cls59
Martin Batholdy wrote: is it possible to convert latex code to pdf in R (like a latex-program would do it)? Is there a package that comes with this capabilities? Unfortunately you're out of luck if you're seeking a direct path from LaTeX code generated in R to pdf without passing

[R] geoR, variofit

2009-09-17 Thread Sascha Bellaire
Hello All! I calculate a variogram using the function variog (package geoR) afterwards I use variofit to fit a spherical model (see code below). Now I just changed the units of the variable (in this case MPa to kPa just a factor of 1000). If I do so, I get a different fit and therefore

[R] Quadradic constraint in optimization of linear program

2009-09-17 Thread pragathichi
Can someone suggest which package is required for optimization of linear program with quadradic constraint. Eg max x1+x2+x3 subject to x1+x2+x3=10 x3^2 = 0 -- View this message in context: http://www.nabble.com/Quadradic-constraint-in-optimization-of-linear-program-tp25487057p25487057.html

Re: [R] latex code in R - convert to pdf

2009-09-17 Thread baptiste auguie
Hi, for basic tables (e.g. display a data.frame without fancy formatting), you could try the textplot() function from the gplots package, or this rough function for Grid graphics, source(http://gridextra.googlecode.com/svn/trunk/R/tableGrob.r;) # install.packages(gridextra,

Re: [R] latex code in R - convert to pdf

2009-09-17 Thread Philipp Pagel
On Thu, Sep 17, 2009 at 10:08:57AM +0200, Philipp Pagel wrote: is it possible to convert latex code to pdf in R (like a latex-program would do it)? Is there a package that comes with this capabilities? My problem is that I want to generate tables automatically - and I can't use

Re: [R] latex code in R - convert to pdf

2009-09-17 Thread David Hajage
Hello, You could try : - odfWeave : to generate odf (open office...) report - R2HTML and hwriter : to generate html report - ascii : to generate asciidoc http://www.methods.co.nz/asciidoc/ report and then convert it to html, xml, pdf and more. 2009/9/17 Philipp Pagel p.pa...@wzw.tum.de On

Re: [R] R functions with array arguments

2009-09-17 Thread baptiste auguie
Try this, sapply(Mabslim , my_gamma, alpha=-1, xstar = -21, xmax = -27) or wrap it with ?Vectorize, vmy_gamma = Vectorize(my_gamma, vectorize.args = xlim) vmy_gamma(alpha=-1, xstar = -21, xlim= Mabslim, xmax = -27) HTH, baptiste 2009/9/17 Maurizio Paolillo paoli...@na.infn.it: Dear R

Re: [R] Turning points in a series

2009-09-17 Thread Ted Harding
On 17-Sep-09 08:10:47, ogbos okike wrote: Good morning once more. My problem of yesterday has been addressed. Having learned a few tricks from that, I wish to ask another question in connection with that. My data is a cosmic ray data consisting of dates and counts. When I plot a graph of

Re: [R] How to extract data.frame columns using regex?

2009-09-17 Thread Schalk Heunis
I think this is what you want: df - data.frame(x1=1:11,x2=2:12,x3=3:13,y=4:14) grep('^x',names(df)) [1] 1 2 3 The returned indexes refer to the column positions, so you could do: names(df)[grep('^x',names(df))] [1] x1 x2 x3 or df[,grep('^x',names(df))] x1 x2 x3 1 1 2 3 2 2 3 4 3 3

[R] package documentation of S4 methods

2009-09-17 Thread El Gorgonzola
Hi, I'm new to this mailing list and to R-programming so if the question is stupid I apologize. I have to create a package, which includes an S4-class called BList. For objects of this class I implemented a method show, which displays the first 15 data-lines of the object. I further

[R] JGR install and run question

2009-09-17 Thread David Young
Hello all, I tried to install the GUI interface JGR for R yesterday on my Windows Vista machine running R 2.9.2. It did install and run but whenever I ran the package manager it crashed. It also did not appear to display all the available packages. For instance Hmisc and bayesm were not in the

[R] JGR install and run question

2009-09-17 Thread David Young
Hello all, I tried to install the GUI interface JGR for R yesterday on my Windows Vista machine running R 2.9.2. It did install and run but whenever I ran the package manager it crashed. It also did not appear to display all the available packages. For instance Hmisc and bayesm were not in the

Re: [R] How to extract data.frame columns using regex?

2009-09-17 Thread Martin Maechler
SH == Schalk Heunis schalk.heu...@enerweb.co.za on Thu, 17 Sep 2009 11:15:16 +0200 writes: SH I think this is what you want: df - data.frame(x1=1:11,x2=2:12,x3=3:13,y=4:14) grep('^x',names(df)) SH [1] 1 2 3 SH The returned indexes refer to the column positions, so you

Re: [R] Turning points in a series

2009-09-17 Thread Philippe Grosjean
Hello, I don't see what's wrong with turnpoints() from pastecs. It is easy to use, and provides additional information for each turnpoints, i.e., probability of occurrence against the null hypothesis that the series is purely random, and the number of bits of information associated with the

Re: [R] How to extract data.frame columns using regex?

2009-09-17 Thread Romain Francois
On 09/17/2009 12:04 PM, Martin Maechler wrote: SH == Schalk Heunisschalk.heu...@enerweb.co.za on Thu, 17 Sep 2009 11:15:16 +0200 writes: SH I think this is what you want: df- data.frame(x1=1:11,x2=2:12,x3=3:13,y=4:14) grep('^x',names(df)) SH [1] 1 2 3 SH

[R] Problems with the commands FUNCTION and DERIV to build a polynomial

2009-09-17 Thread Noela Sánchez
Hi all, I need to automate a process in order to prepare a a big loop in the future but I have a problem with the *command function* First I fit a model with lm model1-lm(data2[,2]~data2[,1]+I(data2[,1]^2)+I(data2[,1]^3)+I(data2[,1]^4)) I extract the coefficients to build the polynomial.

Re: [R] JGR install and run question

2009-09-17 Thread Gabor Grothendieck
I've had similar problems. See: http://article.gmane.org/gmane.comp.lang.r.rosuda.devel/747 Although a bit out of date, there is a page on GUIs for R at these two links: http://www.sciviews.org/_rgui/ http://wiki.r-project.org/rwiki/doku.php?id=guis:guis On Thu, Sep 17, 2009 at 5:58 AM, David

[R] RCurl and Google Scholar's EndNote references

2009-09-17 Thread Jarno Tuimala
Hi! I've performed a Google Scholar Search using a query, let's say Frank Harrell, and parsed the links to the EndNote references from the resulting HTML code. Now I'd like to download all the references automatically. For this, I have tried to use RCurl, but I can't seem to get it working: I

Re: [R] Filling Empty Column with String in read.table

2009-09-17 Thread Henrique Dallazuanna
Try this after read the data file: dat[is.na(dat[,5]),5] - '-' On Thu, Sep 17, 2009 at 3:33 AM, Gundala Viswanath gunda...@gmail.com wrote: I have a data file that looks like this. __DATA__ D7KAR5Z02F447V  176 G   0.22 D7KAR5Z02J3WLG  94  A   1.05    29 D7KAR5Z02F4K6L  198 a   0.13

Re: [R] Quadradic constraint in optimization of linear program

2009-09-17 Thread Gabor Grothendieck
The 2nd constraint holds trivially and the 1st constraint implies that the maximum is 10. The solution is not unique and any values of the variables satisfying the 1st constraint are optimum. No software needed. On Thu, Sep 17, 2009 at 4:19 AM, pragathichi pragathichitr...@tcs.com wrote: Can

[R] What is the time complexity of 'match()'?

2009-09-17 Thread Peng Yu
Hi, Suppose 'x' is a vector of length n and 'y' is a vector of length m, I am wondering what the time complexity of 'match(x,y)' is. Is it n times m? Regards, Peng __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] heatmap.2() problems with re-ordering of rows and columns

2009-09-17 Thread bioinformatics_guy
I have a file of the following form -11 -10 -9 -8 -10 -9 -8 NA -9 -7NA NA -8NA NA NA So basically a NxN matrix of log scores. I want to get a heatmap of these log scores but I'm having a problem. I'm using the following code library(gplots)

Re: [R] poisson lognormal regression

2009-09-17 Thread Ruben Roa Ureta
Dear all, I want to directly write the loglike function of poisson- lognormal regression and then estimate the parameters. the response (Y)is count and I have two explanatory variable (x1:nominal) and (x2:continiuouse). which package in R can be used ?.How can input the data and write the

[R] Error message in Design library

2009-09-17 Thread Richardson, Patrick
This was working a few weeks ago, but perhaps the package has been updated since then. model.1 - lrm(response ~ p_value, data=c_abl_oncogene_1_RTK) When I run the following command . . . . prediction.1 - predict(model.1, type=c(fitted)) I get the following error message. . . . Error in

Re: [R] latex code in R - convert to pdf

2009-09-17 Thread David Winsemius
On Sep 17, 2009, at 4:31 AM, Philipp Pagel wrote: On Thu, Sep 17, 2009 at 10:08:57AM +0200, Philipp Pagel wrote: is it possible to convert latex code to pdf in R (like a latex-program would do it)? Is there a package that comes with this capabilities? My problem is that I want to generate

[R] How to colour the tip labels in a phylogenetic tree

2009-09-17 Thread Graham Etherington
Hi, Using Ape, I have constructed an object of class phylo, using the method 'nj' (lets call the object 'tree_ja'). I also have a given subset of 'tree_ja' in a vector (lets call the vector 'subspecies'). What I want to do, is construct a nj tree - plot(tree_ja) - but have the species in

Re: [R] inline error message

2009-09-17 Thread Uwe Ligges
_ wrote: Hi all, I installed the library inline to my default R-enviroment (c:\Programme\R.. ) downloaded and installed RTools from http://www.murdoch-sutherland.com/Rtools/ to c:\Rtools. Path variable is set right (with respect to order) but I get still the error message from my R Error

Re: [R] Error message in Design library

2009-09-17 Thread David Winsemius
On Sep 17, 2009, at 8:58 AM, Richardson, Patrick wrote: This was working a few weeks ago, but perhaps the package has been updated since then. model.1 - lrm(response ~ p_value, data=c_abl_oncogene_1_RTK) When I run the following command . . . . prediction.1 - predict(model.1,

Re: [R] heatmap.2() problems with re-ordering of rows and columns

2009-09-17 Thread Schalk Heunis
Hi bioinformatics_guy I think you are looking for the image function: image(mat) The heatmap.2 function does hierarchical clustering on rows and columns and then orders the rows and columns according to the results of the clustering. Image simply plots the matrix. HTH Schalk Heunis On Thu,

Re: [R] What is the time complexity of 'match()'?

2009-09-17 Thread Tal Galili
try running it on a grid within system.time() And the answer will be revealed. Tal On Thu, Sep 17, 2009 at 3:15 PM, Peng Yu pengyu...@gmail.com wrote: Hi, Suppose 'x' is a vector of length n and 'y' is a vector of length m, I am wondering what the time complexity of 'match(x,y)' is. Is

Re: [R] What is the time complexity of 'match()'?

2009-09-17 Thread Thomas Lumley
On Thu, 17 Sep 2009, Peng Yu wrote: Hi, Suppose 'x' is a vector of length n and 'y' is a vector of length m, I am wondering what the time complexity of 'match(x,y)' is. Is it n times m? match() hashes the second argument then does hash lookups for the first argument (the source is in

Re: [R] heatmap.2() problems with re-ordering of rows and columns

2009-09-17 Thread bioinformatics_guy
Schalk, Thats a great function! The only question is, is it as flexible as heatmap.2? I figured out how to get it from rearranging the rows and columns but I can't figure out how to label the rows and columns? What I like about the heatmap.2 is that it gives a grid and histogram of the heatmap

Re: [R] Problems with the commands FUNCTION and DERIV to build a polynomial

2009-09-17 Thread Thomas Lumley
On Thu, 17 Sep 2009, [ISO-8859-1] Noela Sánchez wrote: Hi all, I need to automate a process in order to prepare a a big loop in the future but I have a problem with the *command function* First I fit a model with lm

Re: [R] Fastest Way to Divide Elements of Row With Its RowSum

2009-09-17 Thread Thomas Lumley
On Thu, 17 Sep 2009, William Revelle wrote: At 2:40 PM +0900 9/17/09, Gundala Viswanath wrote: I have a data frame (dat). What I want to do is for each row, divide each row with the sum of its row. The number of row can be large 1million. Is there a faster way than doing it this way?

[R] How to generate a matrix where each row (or column) is the same vector?

2009-09-17 Thread Peng Yu
Hi, I can use the following code to generate a matrix, each column of which is 'x'. But I have to specify '5' twice in the second command. I am wondering if there is a better way to do it. x=1:10 matrix(rep(x,5),nc=5) t(matrix(rep(x,5),nc=5)) Regards, Peng

Re: [R] How to generate a matrix where each row (or column) is the same vector?

2009-09-17 Thread Romain Francois
On 09/17/2009 04:02 PM, Peng Yu wrote: Hi, I can use the following code to generate a matrix, each column of which is 'x'. But I have to specify '5' twice in the second command. I am wondering if there is a better way to do it. x=1:10 matrix(rep(x,5),nc=5) t(matrix(rep(x,5),nc=5)) Regards,

Re: [R] How to generate a matrix where each row (or column) is the same vector?

2009-09-17 Thread Romain Francois
On 09/17/2009 04:02 PM, Peng Yu wrote: Hi, I can use the following code to generate a matrix, each column of which is 'x'. But I have to specify '5' twice in the second command. I am wondering if there is a better way to do it. x=1:10 matrix(rep(x,5),nc=5) t(matrix(rep(x,5),nc=5)) Regards,

Re: [R] How to generate a matrix where each row (or column) is the same vector?

2009-09-17 Thread Henrique Dallazuanna
Or: replicate(5, 1:10) On Thu, Sep 17, 2009 at 11:02 AM, Peng Yu pengyu...@gmail.com wrote: Hi, I can use the following code to generate a matrix, each column of which is 'x'. But I have to specify '5' twice in the second command. I am wondering if there is a better way to do it. x=1:10

[R] Why S4 method is not visible from another package?

2009-09-17 Thread Gábor Csárdi
Dear All, maybe this is something obvious, I seem to be incapable of understanding how S4 works. So, in package 'A' I defined a summary method for my class: setMethod(summary, signature(object=ListHyperGResult), function(object, pvalue=pvalueCutoff(object), categorySize=NULL) {

Re: [R] heatmap.2() problems with re-ordering of rows and columns

2009-09-17 Thread Schalk Heunis
Try placing the column names into labCol and the rownames into labRow e.g.heatmap.2(mat,dendrogram=c(none), Rowv=F, Colv=F, labRow = seq(-7.5,7.5,by=5), labCol=seq(-3,3,by=2)) Schalk Heunis On Thu, Sep 17, 2009 at 3:53 PM, bioinformatics_guy wwwhite...@gmail.comwrote: Schalk, Thats a great

Re: [R] comparing random forests and classification trees

2009-09-17 Thread jamesmcc
Greetings tree and forest coders- I'm interested in comparing randomforests and regression tree/ bagging tree models. I'd like to propose a basis for doing this, get feedback, and document this here. I kept it in this thread since that makes sense. In this case I think it's appropriate to

[R] What does model.matrix() return?

2009-09-17 Thread Peng Yu
Hi, I don't understand what the meaning of the following lines returned by model.matrix(). Can somebody help me understand it? What can they be used for? attr(,assign) [1] 0 1 2 2 attr(,contrasts) attr(,contrasts)$A [1] contr.treatment attr(,contrasts)$B [1] contr.treatment Regards, Peng a=2

Re: [R] comparing random forests and classification trees

2009-09-17 Thread Frank E Harrell Jr
The validate.rpart function in the rms package will handle the rpart part of this. It makes sure that the tree is re-built from scratch for each re-sample. It estimates MSE and Somers' Dxy (twice (ROC area -.5)). Frank jamesmcc wrote: Greetings tree and forest coders- I'm interested in

[R] How to do a PCA with ordered variables?

2009-09-17 Thread P.Branco
Hi, I want to do a pca using a set of variables which are ordered. I have used the dudi.mix method from the ade4 package, but when I do the $index it shows me that R has considered my variables as quantitative. What should I do? -- View this message in context:

[R] SVM

2009-09-17 Thread Samuel Okoye
Hello, I have 12 sample each sample has got 1000 observation, i.e I have a matrix X with 1000 rows and 12 columns! m - svm(t(X)) p - predict (m) Can anyone tell me how to use svmtrain() in R! Many Yhanks, Samuel [[alternative HTML version deleted]]

[R] hint required code in Tinn-R

2009-09-17 Thread hentati.sundb
Dear Tinn-R users, I've a basic question: I don't understand how to configure Tinn-R to hint about the required elements in a certain code, e.g. when typing mean( a box would pop-up just above the code informing that (x, trim = 0, na.rm = FALSE, ...) is the required info which must be

[R] How to separate a function by 2 probabilities

2009-09-17 Thread Marcio Resende
Good Mourning, I have a function to generate a matrix as I show part of it; g[j,i]-if (gen[j,i]==0) al1[i,1]+al1[i,1] else ... However i would like that this function occurred with a probability P and that another function (another formula to generate g matrix) with probability P-1 That´s it,

[R] Problems with the commands FUNCTION and DERIV to build a polynomial

2009-09-17 Thread Noela Sánchez
Hi all, I need to automate a process in order to prepare a a big loop in the future but I have a problem with the *command function* First I fit a model with lm model1-lm(data2[,2]~data2[,1]+I(data2[,1]^2)+I(data2[,1]^3)+I(data2[,1]^4)) I extract the coefficients to build the polynomial.

[R] Simple as.Date question dealing with a timezone offset

2009-09-17 Thread esawdust
I've been trying to understand the as.Date functionality and I have a date and time stamp field that looks like this: Tue Sep 15 09:22:09 -0600 2009 and I need to turn it into an R Date object for analysis. Simple date conversions I have down, no problem: adate = c(7/30/1959)

Re: [R] SVM

2009-09-17 Thread Steve Lianoglou
Hi, On Sep 17, 2009, at 7:39 AM, Samuel Okoye wrote: Hello, I have 12 sample each sample has got 1000 observation, i.e I have a matrix X with 1000 rows and 12 columns! m - svm(t(X)) p - predict (m) Can anyone tell me how to use svmtrain() in R! I guess you're using the svm in the e1071

[R] stableFit

2009-09-17 Thread tzygmund mcfarlane
A quick question about stableFit() in the fBasics package. Is it possible to constrain the gamma and delta parameters and only estimate the alpha and beta parameters? I tried: ## set.seed(1953) r = rstable(n = 1000, alpha = 1.9, beta = 0.3) stableFit(r, gamma=1, delta=0, type=c(q,

[R] r-inferno.pdf with detailed table of contents and bookmarks

2009-09-17 Thread Peng Yu
Hi, I don't find a r-inferno.pdf that has detailed table of contents and bookmarks. If it is possible, can somebody help generated one and post it on line? Regards, Peng __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] How to separate a function by 2 probabilities

2009-09-17 Thread Schalk Heunis
Marcio Define two functions, e.g. f1-function(i,j) i+j f2-function(i,j) i-j then call them based on the probability e.g. 0.7 f - if(runif(1)0.7) f1 else f2 f(1,1) or more compact (if(runif(1)0.7) f1 else f2)(1,1) HTH Schalk Heunis On Thu, Sep 17, 2009 at 5:10 PM, Marcio Resende

[R] lpSolve constraints don't seem to have an effect

2009-09-17 Thread Adam Lenart
Dear R users, I would like to optimize a linear approximation of a quadratic function using lpSolve. My code runs without any error or warning message but the constraints that I set don't seem to work properly. Nevertheless, I am certain that my code is somewhere wrong. I would like to solve

Re: [R] How to separate a function by 2 probabilities

2009-09-17 Thread Bert Gunter
Assuming storage is not a problem, first generate two matrices, one by each method, call these A and B. Then if dim(A) = dim(B) = c(m,n) and k = m*n z - rbinom(k,1, .7) result - A*z + B*(1-z) Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From:

[R] QQ plotting of various distributions...

2009-09-17 Thread Petar Milin
Hello! I am trying with this question again: I would like to test few distributional assumptions for some behavioral response data. There are few theories about true distribution of those data, like: normal, lognormal, gamma, ex-Gaussian (exponential-Gaussian), Wald (inverse Gaussian) etc. The

Re: [R] How to do a PCA with ordered variables?

2009-09-17 Thread Mark Difford
P. Branco wrote: I have used the dudi.mix method from the ade4 package, but when I do the $index it shows me that R has considered my variables as quantitative. What should I do? You should make sure that they are encoded as ordered factors, which has nothing to do with ade4's

[R] Odp: boxplot

2009-09-17 Thread Petr PIKAL
Hi I do not know rma but from help page boxplot requires as input a formula, list (only some list of numerics), data frame or numeric vector. I am not sure if your object is one of these. If not you need to convert it to object which is acceptable for boxplot. Regards Petr

[R] Dealing with heterogeneity with varComb weights

2009-09-17 Thread RS27
Hi, I am trying to add multiple variance structures such as the first example below: vf1 - varComb(varIdent(form = ~1|Sex), varPower()) However my code below will not work can anybody please advise me? VFcomb-varComb(varExp(form=~depcptwithextybf),varFixed(form=~FebNAO)) also if you have two

Re: [R] Why S4 method is not visible from another package?

2009-09-17 Thread Martin Morgan
Gábor Csárdi wrote: Dear All, maybe this is something obvious, I seem to be incapable of understanding how S4 works. So, in package 'A' I defined a summary method for my class: setMethod(summary, signature(object=ListHyperGResult), function(object,

[R] Odp: What is the best way to get a subset of a data.frame?

2009-09-17 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 17.09.2009 04:14:24: Hi, I want to construct a data.frame 'y' by using x$x and x$y. I think that there might be better ways to do it (because, for example, we can use a_matrix[3:5,] to extract certain rows, where 'a_matrix' is a matrix). Can

[R] Help with date specification

2009-09-17 Thread Subodh Acharya
Hi everyone,I have a data daily data (x) for 10 years starting from 04-01-1995 to 03-31-2005. I was able to get the yearly sum for the ten years using aggregate(x, years, sum). But this gave me the yearly sum for 1995 (Apr- Dec); 1996 (Jan-Dec) -2005 (Jan-Mar). But I want to get the

Re: [R] Which one shall I use? '=' or '-'?

2009-09-17 Thread David M Smith
I wrote a post on the Revolutions blog a little while back discussing the difference between the two (and the history of the - operator). You can find it on blog.revolution-computing.com at: http://bit.ly/3YWw3R # David Smith On Wed, Sep 16, 2009 at 7:58 PM, Peng Yu pengyu...@gmail.com wrote:

Re: [R] Help with date specification

2009-09-17 Thread Schalk Heunis
Subodh Assuming the data is ordered by date then you can define fin.years = (0:(10*12-1)) %/% 12 then use aggregate: aggregate(x, list(fin.years),sum) HTH Schalk Heunis On Thu, Sep 17, 2009 at 6:11 PM, Subodh Acharya shoeb...@gmail.com wrote: Hi everyone,I have a data daily data (x) for 10

Re: [R] r-inferno.pdf with detailed table of contents and bookmarks

2009-09-17 Thread Victor Manuel Garcia Guerrero
Hey, check this link: http://www.burns-stat.com/pages/Tutor/R_inferno.pdf Greetings Víctor De: r-help-boun...@r-project.org en nombre de Peng Yu Enviado el: jue 17/09/2009 10:43 Para: r-h...@stat.math.ethz.ch Asunto: [R] r-inferno.pdf with detailed table of

Re: [R] Dealing with heterogeneity with varComb weights

2009-09-17 Thread Alain Zuur
RS27 wrote: Hi, I am trying to add multiple variance structures such as the first example below: vf1 - varComb(varIdent(form = ~1|Sex), varPower()) However my code below will not work can anybody please advise me?

Re: [R] How to colour the tip labels in a phylogenetic tree

2009-09-17 Thread Ben Bolker
Graham Etherington wrote: Hi, Using Ape, I have constructed an object of class phylo, using the method 'nj' (lets call the object 'tree_ja'). I also have a given subset of 'tree_ja' in a vector (lets call the vector 'subspecies'). What I want to do, is construct a nj tree -

Re: [R] Help with date specification

2009-09-17 Thread Gabor Grothendieck
Try either of these which convert to year and qtr and then shift the qtr by one. The resulting series is labeled by the year in which the series dates start. Use as.integer(...) + 1 if you prefer to label by ending year. library(zoo) # test data DF - data.frame(date = Sys.Date() + 1:1000, value

Re: [R] Help with date specification

2009-09-17 Thread Mark Knecht
On Thu, Sep 17, 2009 at 9:11 AM, Subodh Acharya shoeb...@gmail.com wrote: Hi everyone,I have a data daily data (x) for 10 years starting from 04-01-1995 to 03-31-2005. I was able to get the yearly sum for the ten years using aggregate(x, years, sum). But this gave me the yearly sum for 1995

Re: [R] Fastest Way to Divide Elements of Row With Its RowSum

2009-09-17 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Thomas Lumley Sent: Thursday, September 17, 2009 6:59 AM To: William Revelle Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] Fastest Way to Divide Elements of Row With Its RowSum

Re: [R] r-inferno.pdf with detailed table of contents and bookmarks

2009-09-17 Thread Patrick Burns
That's a reasonable request that I have planned for whenever I revise it. However, I'm not going to be doing that for some time yet (unit of time is somewhere in the months to years range). If someone is keen to do that, I can make the LyX file available to them. Patrick Burns

[R] Grouped Logistic (Or conditional Logistic.)

2009-09-17 Thread Noah Silverman
Hi, I'm not sure of the correct nomenclature or function for what I'm trying to do. I'm interested in calculated a logistic regression on a binary dependent variable (True,False). There are a few ways to easily do this in R. Both SVM and GLM work easily. The part that I want to add is

[R] Hi

2009-09-17 Thread MOKGATLHE, L.L. (DR.)
Can I run a lack-of-fit test using R? How do I do that? Thank you [[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

Re: [R] ggplot, ribbon not showing up properly

2009-09-17 Thread Sock Cheng
Hi Thierry, I tried the code suggested below, but it didn't work fully. The ribbon showed up correctly for first and last days, but the days in between appeared to be ignored. I tried other ways of feeding geom_ribbon the summary stats but my ways didn't work either. Thanks for trying to

[R] define a new family (and a new link function) for gam in gam package

2009-09-17 Thread Topi, Corrado
Dear R list, is it possible to define a new family (and a new link function) for gam in gam package? How? I read the help for gam, family, gam.model, make.link but I did not find a solution. Regards -- Corrado Topi Area 18,Department of Biology University of York, York, YO10 5YW, UK

Re: [R] inline error message

2009-09-17 Thread Duncan Murdoch
On 9/17/2009 9:16 AM, Uwe Ligges wrote: _ wrote: Hi all, I installed the library inline to my default R-enviroment (c:\Programme\R.. ) downloaded and installed RTools from http://www.murdoch-sutherland.com/Rtools/ to c:\Rtools. Path variable is set right (with respect to order) but I get

Re: [R] How to do a PCA with ordered variables?

2009-09-17 Thread Stas Kolenikov
If you are really serious about your variables being ordinal, you should analyze them using polychoric correlations. See polycor package by John Fox. On Thu, Sep 17, 2009 at 10:52 AM, Mark Difford mark_diff...@yahoo.co.uk wrote: I have used the dudi.mix method from the ade4 package, but when I

Re: [R] R functions with array arguments

2009-09-17 Thread Maurizio Paolillo
__ 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 and provide commented, minimal, self-contained, reproducible code.

Re: [R] Grouped Logistic (Or conditional Logistic.)

2009-09-17 Thread Ted Harding
On 17-Sep-09 17:28:16, Noah Silverman wrote: Hi, I'm not sure of the correct nomenclature or function for what I'm trying to do. I'm interested in calculated a logistic regression on a binary dependent variable (True,False). There are a few ways to easily do this in R. Both SVM and GLM

[R] dyn.load search path?

2009-09-17 Thread Steve Jaffe
Sorry if this is somewhere in the fine manuals but I've been unable to locate it. Does dyn.load use a search path or does it just look in the current directory for non-fully-qualified filenames? If there is a search path, what is it? Thanks for your help -- View this message in context:

Re: [R] Simple as.Date question dealing with a timezone offset

2009-09-17 Thread David Winsemius
On Sep 17, 2009, at 11:25 AM, esawdust wrote: I've been trying to understand the as.Date functionality and I have a date and time stamp field that looks like this: Tue Sep 15 09:22:09 -0600 2009 and I need to turn it into an R Date object for analysis. Simple date conversions I have

Re: [R] Grouped Logistic (Or conditional Logistic.)

2009-09-17 Thread Noah Silverman
Ted, Thanks for the reply. For the example, I'm not looking to predict THE winner, but to find the best probabilities of winning. It would seem that the process of iterating through possible coefficients would be the same as a standard GLM, the evalation part as you work through them would

Re: [R] Grouped Logistic (Or conditional Logistic.)

2009-09-17 Thread David Winsemius
On Sep 17, 2009, at 2:06 PM, (Ted Harding) wrote: On 17-Sep-09 17:28:16, Noah Silverman wrote: Hi, I'm not sure of the correct nomenclature or function for what I'm trying to do. I'm interested in calculated a logistic regression on a binary dependent variable (True,False). There are a few

Re: [R] dyn.load search path?

2009-09-17 Thread cls59
Steve Jaffe wrote: Sorry if this is somewhere in the fine manuals but I've been unable to locate it. Does dyn.load use a search path or does it just look in the current directory for non-fully-qualified filenames? If there is a search path, what is it? Thanks for your help I

[R] How write the same number of elements in the first line as the rest of the file with write.table()?

2009-09-17 Thread Peng Yu
Hi, The first line has less elements than the rest of 'rownames_colnames.write.table.xls'. I am wondering if there is a way to print an additional '\t' at the beginning of the first line. $ Rscript write.table.R x=matrix(1:20,nc=2) rownames(x)=letters[1:10] colnames(x)=letters[1:2]

Re: [R] How to separate a function by 2 probabilities

2009-09-17 Thread Ben Bolker
Marcio Resende wrote: Good Mourning, I have a function to generate a matrix as I show part of it; g[j,i]-if (gen[j,i]==0) al1[i,1]+al1[i,1] else ... However i would like that this function occurred with a probability P and that another function (another formula to generate g matrix)

Re: [R] How write the same number of elements in the first line as the rest of the file with write.table()?

2009-09-17 Thread David Winsemius
On Sep 17, 2009, at 3:23 PM, Peng Yu wrote: Hi, The first line has less elements than the rest of 'rownames_colnames.write.table.xls'. I am wondering if there is a way to print an additional '\t' at the beginning of the first line. $ Rscript write.table.R x=matrix(1:20,nc=2)

[R] generating unordered combinations

2009-09-17 Thread Dan Halligan
Hi, I am trying to generate all unordered combinations of a set of numbers / characters, and I can only find a (very) clumsy way of doing this using expand.grid. For example, all unordered combinations of the numbers 0, 1, 2 are: 0, 0, 0 0, 0, 1 0, 0, 2 0, 1, 1 0, 1, 2 0, 2, 2 1, 1, 1 1, 1, 2 1,

Re: [R] What does model.matrix() return?

2009-09-17 Thread David Winsemius
On Sep 17, 2009, at 11:13 AM, Peng Yu wrote: Hi, I don't understand what the meaning of the following lines returned by model.matrix(). Can somebody help me understand it? What can they be used for? attr(,assign) [1] 0 1 2 2 attr(,contrasts) attr(,contrasts)$A [1] contr.treatment

[R] referring to a row number and to a row condition, and to columns simultaneously

2009-09-17 Thread Dimitri Liakhovitski
Hello, dear R-ers! I have a data frame: x-data.frame(a=c(4,2,4,1,3,4),b=c(1,3,4,1,5,0),c=c(NA,2,5,3,4,NA),d=rep(NA,6),e=rep(NA,6)) x When x$a==1, I would like to replace NAs in columns d and e with 8 and 9, respectively When x$a != 1, I would like to replace NAs in columns d and e 101 and 1022,

  1   2   >