Re: [R] Incorrect Dimension

2009-09-17 Thread Schalk Heunis
On Fri, Sep 18, 2009 at 8:12 AM, Schalk Heunis wrote: > Marcio > Looking at the script (not much explanation re your intention), I think > there is a couple of problems: > 1. Not sure if the attached was supposed to be working code, but the > assignment operator is <- not <= > 2. The functions sho

Re: [R] Datetime conversion

2009-09-17 Thread David Winsemius
On Sep 18, 2009, at 1:03 AM, premmad wrote: I'm relatively new to R .I tried converting the datetime column with values like 01apr1985:00:00:00.000 using strptime(datetime,"%d%b%Y).Could anyone help me in this regard .Please reply ASAP i need . You will need to give us a more complete s

Re: [R] Incorrect Dimension

2009-09-17 Thread Schalk Heunis
Marcio Looking at the script (not much explanation re your intention), I think there is a couple of problems: 1. Not sure if the attached was supposed to be working code, but the assignment operator is <- not <= 2. The functions should be defined OUTSIDE the loop, otherwise you are redefining the f

[R] Suppressing script commands in R console when executing long program

2009-09-17 Thread Steven Kang
Hi R users, I have a script composing of more than 1000 lines and would like suppress the R codes from the console when executing the script (to reduce the physical processing time) I have tried options(echo=T) but no luck.. *Q1. Are there any way of suppressing the commands in the R console?*

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

2009-09-17 Thread Gabor Grothendieck
That doesn't change the fact that the maximum is still 10. On Thu, Sep 17, 2009 at 11:40 PM, pragathichi wrote: > > Sorry i made a mistake in the example my Quadradic constraint is > X3^2-3.6 * X3 >= 0 > > Gabor Grothendieck wrote: >> >> The 2nd constraint holds trivially and the 1st constraint i

[R] Errors and line numbers in scripts?

2009-09-17 Thread ws
Is there a way to have R return the line number in a script when it errors out? I call my script like: $ R --vanilla < script.R > output.txt I seem to remember a long discussion about this at some point, but I can't remember the outcome. Tx __ R-

Re: [R] SVM

2009-09-17 Thread Samuel Okoye
Thank you for your reply! Yes, I am using the svm and I do not have new data (how do you create new data?), all I have these 12 samples which I want to classify (predict) these into two group so that I do have six sample in each group? Many thanks, Samuel --- On Thu, 9/17/09, Steve Lianoglou

[R] Datetime conversion

2009-09-17 Thread premmad
I'm relatively new to R .I tried converting the datetime column with values like 01apr1985:00:00:00.000 using strptime(datetime,"%d%b%Y).Could anyone help me in this regard .Please reply ASAP i need . -- View this message in context: http://www.nabble.com/Datetime-conversion-tp25503138p25503138

[R] Incorrect Dimension

2009-09-17 Thread Marcio Resende
I am new in R and i am having trouble here. I´ve already searched in the list but hasn´t helped When i run this script above i get the message "Error in gen[j, i] : incorrect number of dimensions". However gen is 1000x200 (ind x loc) and so is g could anybody help me for (i in 1 : loc) { #l

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

2009-09-17 Thread pragathichi
Sorry i made a mistake in the example my Quadradic constraint is X3^2-3.6 * X3 >= 0 Gabor Grothendieck wrote: > > 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 constrai

[R] Program with indicatrix function

2009-09-17 Thread MarcioRibeiro
Hi listers, First I programmed the calcul of a empirical distribution function given by: F_hat(y)=(1/n)*Sum[Ind(yi<=y)] I checked the ecdf function and I found out how does it works... A modification of the function would be: n<-6 x<-c(10,12,7,7,5,4) vals<-unique(x) edf<-cumsum(tabulate(match(x,

Re: [R] RCurl and Google Scholar's EndNote references

2009-09-17 Thread Duncan Temple Lang
Hi Jarno You've only told us half the story. You didn't show how you i) performed the original query ii) retrieved the URL you used in subsequent queries But I can suggest two possible problems. a) specifying the cookiejar option tells libcurl where to write the cookies that the particular

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

2009-09-17 Thread Sunil Suchindran
This describes the way in which categorical variables are coded in the model. In this case, we see "treatment" coding, although this can go by different names in textbooks (for example, reference cell coding). attr(,"assign") [1] 0 1 2 2 means that the first column of the model matrix corresponds

Re: [R] Ubuntu 2.9.2 packages broken for amd64

2009-09-17 Thread Dirk Eddelbuettel
Ivan, On 17 September 2009 at 21:22, Ivan Adzhubey wrote: | Attempt to install R 2.9.2 on Ubuntu 9.04 results in errors: | | $ sudo apt-get install r-base | Reading package lists... Done | Building dependency tree | Reading state information... Done | Some packages could not be installed. This m

[R] Ubuntu 2.9.2 packages broken for amd64

2009-09-17 Thread Ivan Adzhubey
Hi, Attempt to install R 2.9.2 on Ubuntu 9.04 results in errors: $ sudo apt-get install r-base Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are

[R] Help with lm with a nested effect

2009-09-17 Thread Timothy Clough
Dear All, I am running an ANOVA model with three factors: FEATURE (3 levels), GROUP (5 levels), and PATIENT (2 levels), where PATIENT is nested within GROUP. fit <- lm(ABUNDANCE ~ FEATURE + GROUP + FEATURE:GROUP + GROUP/PATIENT, example) However, the design is not balanced: PATIENT1 in

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

2009-09-17 Thread Gabor Grothendieck
Using strapply() from the gsubfn package, apply the pattern (2nd arg) to string (1st arg). The matches to the back references (i.e. the portions of the pattern in parens) are passed to separate arguments of the These arguments are date, offset and year respectively. Then the function calculates t

Re: [R] SVM

2009-09-17 Thread Saeed Abu Nimeh
read Support Vector Machines in R http://www.jstatsoft.org/v15/i09/paper On Thu, Sep 17, 2009 at 4: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 a

Re: [R] generating unordered combinations

2009-09-17 Thread William Dunlap
There is a 1-1 correspondance between your n-sets consisting of m possible element types (0 through m-1 in your example) and the number of n-subsets of a (n+m-1)-set. E.g., your example had m=3 and n=3 and subtracting 1:3 from each column of combn(3+3-1,3) gives your result: > t(combn(3+3-1, 3)-(

Re: [R] generating unordered combinations

2009-09-17 Thread G. Jay Kerns
Dear Dan, On Thu, Sep 17, 2009 at 5:31 PM, Erik Iverson wrote: > Dan, > > Still maybe a bit ugly, but no looping... > >> unique(as.data.frame(t(apply(expand.grid(0:2, 0:2, 0:2), 1, sort The prob package provides a convenience wrapper for (essentially) Erik's solution: library(prob) urnsamp

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

2009-09-17 Thread Dimitri Liakhovitski
Thanks a lot for your great suggestions! Dimitri On Thu, Sep 17, 2009 at 5:48 PM, David Winsemius wrote: > > On Sep 17, 2009, at 5:17 PM, Dimitri Liakhovitski wrote: > >> 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(N

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

2009-09-17 Thread David Winsemius
On Sep 17, 2009, at 1:39 PM, Topi, Corrado wrote: 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. Wood provides an example for negbin with alte

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

2009-09-17 Thread David Winsemius
On Sep 17, 2009, at 5:17 PM, Dimitri Liakhovitski wrote: 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 !=

Re: [R] SVM

2009-09-17 Thread Steve Lianoglou
Hi, On Sep 17, 2009, at 5:34 PM, Samuel Okoye wrote: Thank you for your reply! Yes, I am using the svm and I do not have new data (how do you create new data?), all I have these 12 samples which I want to classify (predict) these into two group so that I do have six sample in each group?

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

2009-09-17 Thread Schalk Heunis
Try this x[(row(x[1]) %in% 2:5) & x$a==1,4:5] <- c(8,9) x[(row(x[1]) %in% 2:5) & x$a!=1,4:5] <- c(101,102) HTH Schalk Heunis On Thu, Sep 17, 2009 at 11:17 PM, Dimitri Liakhovitski wrote: > 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,

Re: [R] generating unordered combinations

2009-09-17 Thread Erik Iverson
Dan, Still maybe a bit ugly, but no looping... > unique(as.data.frame(t(apply(expand.grid(0:2, 0:2, 0:2), 1, sort V1 V2 V3 1 0 0 0 2 0 0 1 3 0 0 2 5 0 1 1 6 0 1 2 9 0 2 2 14 1 1 1 15 1 1 2 18 1 2 2 27 2 2 2 Best, Erik > -Original Message- > F

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

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" att

[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] 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) rownames(x)=lett

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

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

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 >

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 w

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 wo

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 do

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

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 an

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] 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 wrote: >>> I have used the dudi.mix method from the ade4 package, but when I do the >>> $index it sh

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 sti

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

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 help

[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 http://www.R-project.org

[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 "gr

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 patr...@burns-st

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 R

Re: [R] Help with date specification

2009-09-17 Thread Mark Knecht
On Thu, Sep 17, 2009 at 9:11 AM, Subodh Acharya 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 (Apr- Dec); 199

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

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? > > VFcomb<-varComb(varExp(form=~depcptwithextybf),varFixed(f

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 c

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 wrote: > Hi everyone,I have a data daily data (x) for 10 years starting from

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 wrote: > Hi, > > I was told

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

[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

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, pvalue=pvalue

[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

[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-help-boun...@r-p

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 dud

[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 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-help-boun...@r-p

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

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

[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

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

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 e107

[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") > as.Date(a

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

[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] 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] 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] 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: http://www.nabble.com/How-to-do-

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 com

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

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 compar

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 wrote: > > Schalk, > > Thats a great function! The o

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

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,

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

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 model1<-lm(data2[,2]~data2[,1]+I(data2[,1]^2)+I(data2[,1]^3)+I(data2[,1]^

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] 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 src/mai

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

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

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, type=c("fitt

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 i

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

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 t

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

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] 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) data=read.table("filein.txt",header=

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

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 wrote: > > Can someone suggest which p

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 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 > D7KAR5Z02J4SYO  6

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

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 You

  1   2   >