Re: [R] Re moving levels of a factor

2009-11-11 Thread Uwe Ligges
Dieter Menne wrote: Henrik Wahren wrote: How can one or more levels be removed from a factor of a data frame. There was a similar post on how to do this when a factor meets some criterion (e.g. = 2), but I can¹t seem to get that solution to work. Here, I simply want to drop some levels.

[R] prcomp() PCA vs fastICA() PCA?

2009-11-11 Thread Joel Fürstenberg-Hägg
Hi all, I wonder what the difference is between the functions prcomp and the PCA plotting method used in example 3 from the fastICA package. They give totally different plots. The reason for asking is that I've earlier used prcomp, but now I should do an ICA, and I guess I cannot compare

Re: [R] gsub does not support \b?

2009-11-11 Thread Uwe Ligges
Tan, Richard wrote: Hello, can someone help? How come gsub(\bINDS\b,INDUSTRIES,ADVANCED ENERGY INDS) [1] ADVANCED ENERGY INDS It does, but you need to escape it: gsub(\\bINDS\\b,INDUSTRIES,ADVANCED ENERGY INDS) Uwe Ligges not ADVANCED ENERGY INDUSTRIES Thanks. Richard

Re: [R] What parts of 'Statistical Models in S' are not applicable to R?

2009-11-11 Thread Uwe Ligges
Peng Yu wrote: According to Amazon review, 'Statistical Models in S' is a key reference for understanding the methods implemented in several of S-PLUS' high-end statistical functions, including 'lm()', predict()', 'design()', 'aov()', 'glm()', 'gam()', 'loess()', 'tree()', 'burl.tree()',

Re: [R] please add this email to the maillist

2009-11-11 Thread Ista Zahn
Hi, You can ad it yourself: http://stat.ethz.ch/mailman/listinfo/r-help -Ista On Wed, Nov 11, 2009 at 12:57 AM, 杨江伟 jwyan...@gmail.com wrote: thanks a lot -- Pleasure should be subordinate to duty.        [[alternative HTML version deleted]] __

[R] Polynomial fitting

2009-11-11 Thread Julia Cains
Dear R helpers     Suppose I have a following data   y  - c(9.21, 9.51, 9.73, 9.88, 10.12. 10.21)   t  - c(0, 0.25, 1, 3, 6, 12)   I want to find out the polynomial which fits y in terms of t i.e. y = f(t) some function of t.   e.g.   y = bo + b1*t + (b2 * t^2) + (b3 * t^3) + .. and so on.  

Re: [R] [Rd] NetCDF output in R

2009-11-11 Thread nana
Dear Robert, Thanks for the information. I tried this but it still did not work well. I will try some other option. Nana Browne There is no key to happiness. The door is always open. --- On Tue, 11/10/09, Robert J. Hijmans

[R] Nested ANOVA

2009-11-11 Thread Plankton-81
Hello, I have the following data and would like to get some hints on how to analyze tis data, nested analysis? Habitats: 2 (Seagrass meadows and sandy bottoms) Seasons: 4 (Winter, Spring, Summer and Autumn) Locations: 4 (2 locations for for each habitat and season) Replicates: 3 replicates

Re: [R] What parts of 'Statistical Models in S' are not applicable to R?

2009-11-11 Thread Emmanuel Charpentier
Le mercredi 11 novembre 2009 à 10:22 +0100, Uwe Ligges a écrit : Peng Yu wrote: According to Amazon review, 'Statistical Models in S' is a key reference for understanding the methods implemented in several of S-PLUS' high-end statistical functions, including 'lm()', predict()',

Re: [R] What parts of 'Statistical Models in S' are not applicable to R?

2009-11-11 Thread Uwe Ligges
Emmanuel Charpentier wrote: Le mercredi 11 novembre 2009 à 10:22 +0100, Uwe Ligges a écrit : Peng Yu wrote: According to Amazon review, 'Statistical Models in S' is a key reference for understanding the methods implemented in several of S-PLUS' high-end statistical functions, including

[R] Error in lm() function

2009-11-11 Thread Bogaso
Hi all, I wanted to have a seasonality study like whether a particular month has significant effect as compared to others. Here is my data : 0.10499 0 0 1 0 0 0 0 0 0 0 0 0.00259 0 0 0 1 0 0 0

Re: [R] Data transformation

2009-11-11 Thread jim holtman
Try this: x - read.table(textConnection(idcode1code2 p + 148 0.1 + 157 0.9 + 218 0.4 + 262 0.2 + 243 0.6 + 356 0.7 +

[R] architecture of statistical programming language R

2009-11-11 Thread mustafa_binar
hi, I'm mustafa. I'm a master student Dokuz Eylül University in Izmir/Turkey. nbsp; I focus on Statistical programming language R. I learn architecture of R. But i don't find out any material in internet. Would you like tonbsp;help me this subject? If you have documentations, would you like to

Re: [R] Data transformation

2009-11-11 Thread legen
Your script works very well. Thank you very much. Legen Henrique Dallazuanna wrote: Try this also: xtabs(rep(p, 2) ~ rep(id, 2) + sprintf(var%d, c(code1, code2)), data = x) On Wed, Nov 11, 2009 at 2:10 AM, legen lege...@gmail.com wrote: Thank you for your kind help. Your script

[R] LINEAR MIXED EFFECT

2009-11-11 Thread ANARPCG
CAN ANYONE PLEASE HELP ME WITH THIS i HAVE TO DO A MIXED EFFECT LINEAR MODEL WITH MY DATA DUE TO THE FACT THAT I have pseudoreplication! Although after reading and trying it for several times can get around due to Error in na.fail.default(list(date = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, : missing

Re: [R] Data transformation

2009-11-11 Thread legen
That's what I want. Many thanks for your help. Legen jholtman wrote: Try this: x - read.table(textConnection(idcode1code2 p + 148 0.1 + 157 0.9 + 218 0.4 + 262

Re: [R] Error in lm() function

2009-11-11 Thread Mohamed Lajnef
Hi Bogaso, Try this vecnames-names(test[,2:11]) fmla - as.formula(paste(test[,1] ~ , paste(vecnames, collapse= +))) res-lm(fmla) Regards M Bogaso a écrit : Hi all, I wanted to have a seasonality study like whether a particular month has significant effect as compared to others. Here is my

[R] Passing MULTIPLE arguments from php file to r scripts

2009-11-11 Thread Moumita Das
Hi friends, Again i don't know how to pass multiple arguments from php file to r scripts. Please have a look at this link ; it gives a very simple explanation of passing variables from a PHP page to r scipts.Because i have done the same thing.

Re: [R] Error: cannot allocate vector of size...

2009-11-11 Thread Jens Oehlschlägel
For me with ff - on a 3 GB notebook - 3e6x100 works out of the box even without compression: doubles consume 2.2 GB on disk, but the R process remains under 100MB, rest of RAM used by file-system-cache. If you are under windows, you can create the ffdf files in a compressed folder. For the

Re: [R] Error: cannot allocate vector of size 3.4 Gb

2009-11-11 Thread Benilton Carvalho
Hi Peng, the major problem about your specific case is that when creating the final object, we need to set dimnames() appropriately. This triggers a copy of the object and that's where you get the error you describe. With the current release, unfortunately, there isn't much to do (unless

[R] Loadings and scores from fastICA?

2009-11-11 Thread Joel Fürstenberg-Hägg
Hi all, Does anyone know how to get the independent components and loadings from an Independent Component Analysis (ICA), as well as principal components and loadings from a Pricipal Component analysis (PCA) using the fastICA package? Or perhaps if there's another way to do ICAs in R?

Re: [R] Error in lm() function

2009-11-11 Thread David Winsemius
On Nov 11, 2009, at 7:14 AM, Bogaso wrote: Hi all, I wanted to have a seasonality study like whether a particular month has significant effect as compared to others. Here is my data : 0.10499 0 0 1 0 0 0 0 0 0 0 0 0.00259 0

[R] dividing a matrix by positive sum or negative sum depending on the sign

2009-11-11 Thread Hao Cen
Hi, I have a matrix with positive numbers, negative numbers, and NAs. An example of the matrix is as follows -1 -1 2 NA 3 3 -2 -1 1 1 NA -2 I need to compute a scaled version of this matrix. The scaling method is dividing each positive numbers in each row by the sum of positive numbers in that

[R] R installer can't find math.h, stdio.h

2009-11-11 Thread Ted Harding
This is possibly the wrong list, but anyway ... Using Linux Debian-4.0 Etch (regularly upgraded). I set about installing Simon Woods' soap package -- see: http://www.maths.bath.ac.uk/~sw283/simon/software.html So I downloaded the tar archive soap_0.1-3.tar.gz and then ran (as root) R CMD

[R] update.packages()

2009-11-11 Thread CG Pettersson
Dear all, W.XP I recently upgraded to R2.10.0 and did what I usually do: copied all special libraries from the old installation and then used update.packages() on the command line. Nothing happened. Then I clicked on the same command on the droplist which generated

Re: [R] Unexpected behavior for as.date()

2009-11-11 Thread Therneau, Terry M., Ph.D.
The date library was written 20 or so years ago. It was a very good first effort, but the newer Date library has superior functionality in nearly every way. The date library is still available, for legacy projects such as yours, but I do not advise it for new work. To answer your specific

[R] End of Month date capture

2009-11-11 Thread Research
Dear R-users, I have the following zoo object: x1x2 x3 x4 x5 x6 1998-08-31 -0.0704375904 NA NA NA NA NA 1998-09-01 0.0379028122 NA NA NA NA

[R] Introducing R to statisticians

2009-11-11 Thread Damjan Krstajic
Dear all, I will present R language and R software environment to the Statistical Society of Serbia. As I will doing it to professional statisticians it seems unneccesary to me to present them how R language works in details. I am more interested to present them with the latest facts regarding

Re: [R] dividing a matrix by positive sum or negative sum depending on the sign

2009-11-11 Thread Dimitris Rizopoulos
one approach is the following: mat - rbind(c(-1, -1, 2, NA), c(3, 3, -2, -1), c(1, 1, NA, -2)) mat / ave(abs(mat), row(mat), sign(mat), FUN = sum) I hope it helps. Best, Dimitris Hao Cen wrote: Hi, I have a matrix with positive numbers, negative numbers, and NAs. An example of the matrix

Re: [R] architecture of statistical programming language R

2009-11-11 Thread Ben Bolker
mustafa_binar wrote: hi, I'm mustafa. I'm a master student Dokuz Eylül University in Izmir/Turkey. nbsp; I focus on Statistical programming language R. I learn architecture of R. But i don't find out any material in internet. Would you like tonbsp;help me this subject? If you

Re: [R] Introducing R to statisticians

2009-11-11 Thread Duncan Murdoch
On 11/11/2009 10:26 AM, Damjan Krstajic wrote: Dear all, I will present R language and R software environment to the Statistical Society of Serbia. As I will doing it to professional statisticians it seems unneccesary to me to present them how R language works in details. I am more interested

Re: [R] dividing a matrix by positive sum or negative sum depending on the sign

2009-11-11 Thread David Winsemius
On Nov 11, 2009, at 10:36 AM, Dimitris Rizopoulos wrote: one approach is the following: mat - rbind(c(-1, -1, 2, NA), c(3, 3, -2, -1), c(1, 1, NA, -2)) mat / ave(abs(mat), row(mat), sign(mat), FUN = sum) Very elegant. My solution was a bit more pedestrian, but may have some speed

[R] partial cumsum

2009-11-11 Thread smu
Hello, I am searching for a function to calculate partial cumsums. For example it should calculate the cumulative sums until a NA appears, and restart the cumsum calculation after the NA. this: x - c(1, 2, 3, NA, 5, 6, 7, 8, 9, 10) should become this: 1 3 6 NA 5 11 18 26 35 45 any

[R] How to get the names of list elements when iterating over a list?

2009-11-11 Thread Peng Yu
I need to get the names of the list elements when I iterate over a list. I'm wondering how to do so? alist=list(a=c(1,3),b=c(-1,3),c=c(-2,1)) sapply(alist,function(x){ #need to use the name of x for some subsequent process }) __

[R] problems in installing biomart

2009-11-11 Thread Andreia Fonseca
Dear Forum my machine runs Ubuntu 9.04. I am trying to install Biomart, what I realize is that something is missing and it can't install XML, RCurl but I don't know what more to do, I looked in previous posts but I did not find infoprmation that helped. Thanks Andreia biocLite(biomaRt) Running

Re: [R] problems in installing biomart

2009-11-11 Thread Martin Morgan
Hi Andreia -- Andreia Fonseca wrote: Dear Forum my machine runs Ubuntu 9.04. I am trying to install Biomart, what I realize is that something is missing and it can't install XML, RCurl but I don't know what more to do, I looked in previous posts but I did not find infoprmation that helped.

Re: [R] Introducing R to statisticians

2009-11-11 Thread Karl Ove Hufthammer
On Wed, 11 Nov 2009 10:51:53 -0500 Duncan Murdoch murd...@stats.uwo.ca wrote: If you know their applications you can show how well R does there, And do mention the (increasing) number of books available. It's only a slight exaggeration to say that there are R books on almost any application

Re: [R] Implementation of the Shuffled Complex Evolution (SCE-UA) Algorithm

2009-11-11 Thread Hans W Borchers
Simon Seibert simon.seibert at mytum.de writes: Good evening list, I'm looking for an R implementation of the Shuffled Complex Evolution” (SCE-UA) algorithm after Duan et al. (1993). Does anybody know if there is an extension/ package existing that contains it? Thanks very much for your

Re: [R] How to get the names of list elements when iterating over alist?

2009-11-11 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peng Yu Sent: Wednesday, November 11, 2009 8:02 AM To: r-h...@stat.math.ethz.ch Subject: [R] How to get the names of list elements when iterating over alist? I need to get

Re: [R] partial cumsum

2009-11-11 Thread William Dunlap
Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of smu Sent: Wednesday, November 11, 2009 7:58 AM To: r-help@r-project.org Subject: [R] partial cumsum Hello, I am

[R] Sweave() within a function: objects not found

2009-11-11 Thread Pfaff, Bernhard Dr.
Dear list subscriber, suppose, I do have a minimal Sweave file 'test.Rnw': \documentclass{article} \begin{document} printx= x @ \end{document} Within R, I define the following function: f - function(x){ Sweave(test.Rnw) } The call: f(x = 1:10) results in the following error message:

Re: [R] Is there a way to specify drop=FALSE as the global default?

2009-11-11 Thread Peng Yu
On Mon, Oct 19, 2009 at 7:57 PM, Peng Yu pengyu...@gmail.com wrote: tmp - matrix(1:2) tmp tmp[,1,drop=FALSE] See the above example. Is there a way to make 'drop=FALSE' as global default, so that when I say 'tmp[,1]', R will treat it as 'tmp[,1,drop=FALSE]'? Is there a way to set

Re: [R] partial cumsum

2009-11-11 Thread Karl Ove Hufthammer
On Wed, 11 Nov 2009 08:53:50 -0800 William Dunlap wdun...@tibco.com wrote: x - c(1, 2, 3, NA, 5, 6, 7, 8, 9, 10) should become this: 1 3 6 NA 5 11 18 26 35 45 Perhaps ave(x, rev(cumsum(rev(is.na(x, FUN=cumsum) [1] 1 3 6 NA 5 11 18 26 35 45 Clever way of

Re: [R] dividing a matrix by positive sum or negative sum depending on the sign

2009-11-11 Thread David Winsemius
On Nov 11, 2009, at 10:57 AM, David Winsemius wrote: On Nov 11, 2009, at 10:36 AM, Dimitris Rizopoulos wrote: one approach is the following: mat - rbind(c(-1, -1, 2, NA), c(3, 3, -2, -1), c(1, 1, NA, -2)) mat / ave(abs(mat), row(mat), sign(mat), FUN = sum) Very elegant. My solution was

[R] how to use # in a rd doc in url address

2009-11-11 Thread Patrick Giraudoux
I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} Of course, I suppose this will not work because # is a special character starting a comment line in the rd dialect. I did not found a similar example in Writing R exentions.

Re: [R] partial cumsum

2009-11-11 Thread Karl Ove Hufthammer
On Wed, 11 Nov 2009 18:11:51 +0100 Karl Ove Hufthammer k...@huftis.org wrote: I wish cumsum took a 'na.rm' argument, though. It would make stuff like this much easier. Or, more specifically, a 'na.value', which could perhaps default to 'NA' to get the current behaviour, but which one could

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Daniel Malter
x=\url{http://www..org/myfolder/#myanchor}; print(x,quote=F) Does this work for you? Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag

Re: [R] R.oo and S4?

2009-11-11 Thread Peng Yu
I'm very familiar with C++. In this sense, it is easier for me to learn R.oo according to your advice. On the other hand, S3 and S4 are the most used. I'm wondering what would be the best choice for me. Do you have any recommendation considering the pros and cons of both ways? Is it true that

Re: [R] partial cumsum

2009-11-11 Thread smu
On Wed, Nov 11, 2009 at 08:53:50AM -0800, William Dunlap wrote: Perhaps ave(x, rev(cumsum(rev(is.na(x, FUN=cumsum) [1] 1 3 6 NA 5 11 18 26 35 45 it takes some time to understand how it works, but it's perfect. thank you, stefan

Re: [R] Sweave() within a function: objects not found

2009-11-11 Thread Duncan Murdoch
On 11/11/2009 12:09 PM, Pfaff, Bernhard Dr. wrote: Dear list subscriber, suppose, I do have a minimal Sweave file 'test.Rnw': \documentclass{article} \begin{document} printx= x @ \end{document} Within R, I define the following function: f - function(x){ Sweave(test.Rnw) } The call: f(x

Re: [R] Introducing R to statisticians

2009-11-11 Thread spencerg
To me, R is the language of choice for a rapidly increasing number of people involved in new statistical algorithm development. If they are happy with the tools they currently use, learning R may be a lot of pain for little gain. However, if they want to stay current with the

Re: [R] partial cumsum

2009-11-11 Thread William Dunlap
-Original Message- From: smu [mailto:m...@z107.de] Sent: Wednesday, November 11, 2009 9:26 AM To: William Dunlap Cc: r-help@r-project.org Subject: Re: [R] partial cumsum On Wed, Nov 11, 2009 at 08:53:50AM -0800, William Dunlap wrote: Perhaps ave(x,

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Patrick Giraudoux
Daniel Malter a écrit : x=\url{http://www..org/myfolder/#myanchor}; print(x,quote=F) Does this work for you? Daniel I am not working on consol mode (which would make your suggestion straight applicable), but writing a rd documentationn (the documentation that comes out with the

Re: [R] Comparison of vectors in a matrix

2009-11-11 Thread esterhazy
Yes, thanks for this, this is exactly what I want to do. However, I have a remaining problem which is how to get R to understand that each entry in my matrix is a vector of names. I have been trying to import my text file with the names in each vector of names enclosed in quotes and separated

Re: [R] lme4 glmer how to extract the z values?

2009-11-11 Thread sj
Ben , Thanks! This worked after I updated my version of R (from 2.8.1 to 2.10) . Best, Spencer On Tue, Nov 10, 2009 at 7:04 PM, Ben Bolker bol...@ufl.edu wrote: sj ssj1364 at gmail.com writes: I am using glmer() from lmer(lme4) to run generalized linear mixed models. I can't figure

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Duncan Murdoch
On 11/11/2009 12:15 PM, Patrick Giraudoux wrote: I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} That should work. Of course, I suppose this will not work because # is a special character starting a comment line in the

Re: [R] Comparison of vectors in a matrix

2009-11-11 Thread David Winsemius
On Nov 11, 2009, at 1:02 PM, esterhazy wrote: Yes, thanks for this, this is exactly what I want to do. However, I have a remaining problem which is how to get R to understand that each entry in my matrix is a vector of names. I have been trying to import my text file with the names in

Re: [R] LINEAR MIXED EFFECT

2009-11-11 Thread milton ruser
Dear Ana Golveia, It is completelly impossible someone realise what kind or help you need or what is happening. I suggest you give a look on the posting guide, mainly that part about a minimum reproducible code with self explaining information, etc. Cheers milton On Wed, Nov 11, 2009 at 7:22

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Patrick Giraudoux
Duncan Murdoch a écrit : On 11/11/2009 12:15 PM, Patrick Giraudoux wrote: I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} That should work. Of course, I suppose this will not work because # is a special character

Re: [R] how to use # in a rd doc in url address

2009-11-11 Thread Patrick Giraudoux
Patrick Giraudoux a écrit : Duncan Murdoch a écrit : On 11/11/2009 12:15 PM, Patrick Giraudoux wrote: I am writing a rd doc, and need to use # in a url adress. This would make: \url{http://www..org/myfolder/#myanchor} That should work. Of course, I suppose this will not work because #

Re: [R] source() vs attach()0

2009-11-11 Thread Stefan Zeugner
Duncan Murdoch wrote: Just declaring it there is the only reasonable way, i.e. test-function(foo) { subtest - function() { foo - foo+1 } subtest() return(foo) } The reason you can't somehow assign it within an existing test is that subtest is a different closure every time. Its

[R] as.Date from data.frame

2009-11-11 Thread separent
#Hello, #I loaded data using read.table - I needed to convert a row in the data frame to date class: data V1 V2 V3 V4 1 2008-05-19 2008-04-19 2008-03-21 2008-02-22 2 38.16999817 30.7008 36.8661 35.18999863 3 37.4754 29.9576 36.4508

Re: [R] Comparison of vectors in a matrix

2009-11-11 Thread Tony Plate
This is a tricky data entry problem. The right technique will depend on the fine details of the data, and it's not clear what those are. E.g., when you say In my first column, for example, I have henry , it's unclear to me whether or not the double quotes are part of the data or not - which

[R] Joint counts and spatial autocorrelation - binary data

2009-11-11 Thread DBK
Hi All, I am new to this form and new to R, having just initiated the analysis of my first project using R. I have been working on a logistic model of land use change and am concerned about 1) measuring spatial autocorrelation and 2) including an autocovariate in my model. Here is what I think

Re: [R] as.Date from data.frame

2009-11-11 Thread Steve Lianoglou
Hi, On Nov 11, 2009, at 1:06 PM, separent wrote: #Hello, #I loaded data using read.table - I needed to convert a row in the data frame to date class: data V1 V2 V3 V4 1 2008-05-19 2008-04-19 2008-03-21 2008-02-22 2 38.16999817 30.7008 36.8661

Re: [R] as.Date from data.frame

2009-11-11 Thread Marc Schwartz
On Nov 11, 2009, at 12:06 PM, separent wrote: #Hello, #I loaded data using read.table - I needed to convert a row in the data frame to date class: data V1 V2 V3 V4 1 2008-05-19 2008-04-19 2008-03-21 2008-02-22 2 38.16999817 30.7008 36.8661

Re: [R] as.Date from data.frame

2009-11-11 Thread David Winsemius
On Nov 11, 2009, at 1:06 PM, separent wrote: #Hello, #I loaded data using read.table - I needed to convert a row in the data frame to date class: You _should_ have given the actual code (as the Posting Guide requests), but I would guess that you should have added either as.is=TRUE

Re: [R] Comparison of vectors in a matrix

2009-11-11 Thread esterhazy
That is wonderful, now I think I am all set! Thanks again! Tony Plate wrote: This is a tricky data entry problem. The right technique will depend on the fine details of the data, and it's not clear what those are. E.g., when you say In my first column, for example, I have henry , it's

Re: [R] partial cumsum

2009-11-11 Thread Tony Plate
William Dunlap wrote: Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of smu Sent: Wednesday, November 11, 2009 7:58 AM To: r-help@r-project.org Subject: [R] partial cumsum

[R] fitting a glm with matrix of responses

2009-11-11 Thread Murat Tasan
hi all - quick question: i have a matrix 'y' of response values, with two explanatory variables 'x1' and 'x2'. tested values of 'x1' and 'x2' are sitting in two vectors 'x1' and 'x2'. i want to learn model parameters without unrolling the matrix of response values. example below: # some fake

Re: [R] Automating Plot Commands using a Loop

2009-11-11 Thread Koraelus
Hello, Thank you for responding! The data is in the same format as the example I showed earlier. The data is different from matrix to matrix, but the general format is: Time1Time 2 Time3 Time4 Species1 134 5 Species2 3

[R] fisher.test negative value error

2009-11-11 Thread Bhanu Mangipudi
Hi all, I am new to python, R and rpy2. I having few errors when I am using 'fisher.test' function where I am struck now. Please help to fix these bugs. My code for fisher.test goes this way *from rpy2 import * import rpy2.robjects as robjects def fisherExact(a,b,c,d): v = [a,b,c,d] m =

Re: [R] fitting a glm with matrix of responses

2009-11-11 Thread David Winsemius
On Nov 11, 2009, at 2:24 PM, Murat Tasan wrote: hi all - quick question: i have a matrix 'y' of response values, with two explanatory variables 'x1' and 'x2'. tested values of 'x1' and 'x2' are sitting in two vectors 'x1' and 'x2'. i want to learn model parameters without unrolling the matrix

Re: [R] fisher.test negative value error

2009-11-11 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bhanu Mangipudi Sent: Wednesday, November 11, 2009 11:16 AM To: r-help@r-project.org Subject: [R] fisher.test negative value error Hi all, I am new to python, R and rpy2. I

Re: [R] as.Date from data.frame

2009-11-11 Thread separent
Hello Gentlemen, All of your answers were helpfull. Indeed, 'as.is=TRUE' or 'stringsAsFactors=FALSE' avoid importing as factors, as it did when I imported the table without specifying anything. However, data frames will not allow different datatypes within a single column, so, for time series, I

Re: [R] LINEAR MIXED EFFECT

2009-11-11 Thread Dave Atkins
Milton's point is dead-on, and I would highly encourage you to give the posting guide a look. That said... you might try na.action = na.omit in your call to... actually, we don't know what function you are using (see first point). Regardless, sounds like you have missing data and na.action is

Re: [R] Is there a way to specify drop=FALSE as the global default?

2009-11-11 Thread tlumley
On Wed, 11 Nov 2009, Peng Yu wrote: On Mon, Oct 19, 2009 at 7:57 PM, Peng Yu pengyu...@gmail.com wrote: tmp - matrix(1:2) tmp tmp[,1,drop=FALSE] See the above example. Is there a way to make 'drop=FALSE' as global default, so that when I say 'tmp[,1]', R will treat it as

Re: [R] Error: cannot allocate vector of size...

2009-11-11 Thread tlumley
On Wed, 11 Nov 2009, Larry Hotchkiss wrote: Hi, I'm responding to the question about storage error, trying to read a 300 x 100 dataset into a data.frame. I wonder whether you can read the data as strings. If the numbers are all one digit, each cell would require just 1 byte instead of

[R] Partial correlations and p-values

2009-11-11 Thread dadrivr
I'm trying to write code to calculate partial correlations (along with p-values). I'm new to R, and I don't know how to do this. I have searched and come across different functions, but I haven't been able to get any of them to work (for example, pcor and pcor.test from the ggm package). In

Re: [R] R.oo and S4?

2009-11-11 Thread Gabor Grothendieck
I think it would be best to learn S3 first since that is a fundamental part of R and S4 is an extension of it and also its very simple so there is not much to learn. After that you can branch out. On Mon, Oct 26, 2009 at 2:28 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: S3 and S4 are

Re: [R] Loadings and scores from fastICA?

2009-11-11 Thread Tony Plate
The help for fastICA says: The data matrix X is considered to be a linear combination of non-Gaussian (independent) components i.e. X = SA where columns of S contain the independent components and A is a linear mixing matrix. The value of fastICA is a list with components S (the

[R] thousands separator in console output?

2009-11-11 Thread Patricio Cuarón
Hello, I'm beginning with R and I'm wondering if there's any way to display large values (e.g. 161651654167) using my system's thousands separator or scientific notation. Thanks! [[alternative HTML version deleted]] __ R-help@r-project.org

[R] plotting time series

2009-11-11 Thread morgi2020
Hi, I'm new to R. I've two sort of time series, one sampled every second and other every 30 minutes stored in two data.frames zy1 and zy2. I've joined the two series using date-merge(zy1,zy2, all.x=T,all.y=T) when I want to make a plot, using the code below, it doesn't work. It gives me the

Re: [R] eacf

2009-11-11 Thread ECSANT
Dear Michel, The only thing you need to do is download the TSA package, and read its document. In this document you're gonna find the command eacf, so it's as simple as using the source TSA, and in ur Tinn-R just call the instruction with the options you want. I expect this information to be

[R] Suppressing final spaces in data.frame printouts

2009-11-11 Thread Stavros Macrakis
When printing data.frames, R aligns columns by padding with spaces. For example, print(data.frame(x=c('a','bb','ccc')),right=FALSE)   x 1 a  |-- vertical bar shows end of line 2 bb |-- vertical bar shows end of line 3 ccc|-- vertical bar shows end

Re: [R] thousands separator in console output?

2009-11-11 Thread Marc Schwartz
On Nov 11, 2009, at 3:52 PM, Patricio Cuarón wrote: Hello, I'm beginning with R and I'm wondering if there's any way to display large values (e.g. 161651654167) using my system's thousands separator or scientific notation. Thanks! To get scientific notation as a default for given large

Re: [R] R.oo and S4?

2009-11-11 Thread Henrik Bengtsson
Please what I already wrote in my previous message of this thread. Also, everything in R.oo is based on S3 and it uses standard R constructs and data types to achieve what it does. You can submit packages based on R.oo, and there are several such packages on CRAN, see 'Reverse dependencies' on

Re: [R] Suppressing final spaces in data.frame printouts

2009-11-11 Thread Richard M. Heiberger
Stavros Macrakis wrote: I could of course write my own print function for this, but was wondering if there was a standard way of doing it. If not in R, perhaps there is some way to have ESS delete the final spaces? ESS, or more precisely emacs, can handle that. Use the M-x

Re: [R] partial cumsum

2009-11-11 Thread Carl Witthoft
quote: x - c(1, 2, 3, NA, 5, 6, 7, 8, 9, 10) rev(cumsum(rev(is.na(x [1] 1 1 1 1 0 0 0 0 0 0 A more natural way to do this is cumsum(is.na(c(NA,x[-length(x)]))) [1] 1 1 1 1 2 2 2 2 2 2 endquote Both of which suggest the original problem could also be dealt with by using

Re: [R] Is there a way to specify drop=FALSE as the global default?

2009-11-11 Thread hadley wickham
See the above example. Is there a way to make 'drop=FALSE' as global default, so that when I say 'tmp[,1]', R will treat it as 'tmp[,1,drop=FALSE]'? The following code won't change the defaults, but it would at least let you know when you're making the mistake: trace_all - function(fs,

Re: [R] partial cumsum

2009-11-11 Thread Marc Schwartz
On Nov 11, 2009, at 4:45 PM, Carl Witthoft wrote: By Bill Dunlap: quote: x - c(1, 2, 3, NA, 5, 6, 7, 8, 9, 10) rev(cumsum(rev(is.na(x [1] 1 1 1 1 0 0 0 0 0 0 A more natural way to do this is cumsum(is.na(c(NA,x[-length(x)]))) [1] 1 1 1 1 2 2 2 2 2 2 endquote Both of which

Re: [R] Is there a way to specify drop=FALSE as the global default?

2009-11-11 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of hadley wickham Sent: Wednesday, November 11, 2009 3:03 PM To: Peng Yu Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] Is there a way to specify drop=FALSE as the global default?

[R] Convert to time from epoch

2009-11-11 Thread Alon Ben-Ari
Hello R users, Is anyone familiar with an R function that converts a time expression ( POSIx for example ) to time (seconds/minutes) from epoch? I was unable to find any Best, Alon [[alternative HTML version deleted]] __

Re: [R] Convert to time from epoch

2009-11-11 Thread jim holtman
try this: x - Sys.time() str(x) POSIXct[1:1], format: 2009-11-11 18:40:10 x [1] 2009-11-11 18:40:10 EST as.numeric(x) # secs from 1/1/1970 [1] 1257982810 On Wed, Nov 11, 2009 at 6:29 PM, Alon Ben-Ari alon.ben...@gmail.com wrote: Hello R users, Is anyone familiar with an R function

Re: [R] Implementation of the Shuffled Complex Evolution (SCE-UA) Algorithm

2009-11-11 Thread Felix Andrews
http://code.google.com/p/ihacres/source/browse/trunk/man/SCEoptim.Rd http://code.google.com/p/ihacres/source/browse/trunk/R/sce.R source(http://ihacres.googlecode.com/svn/trunk/R/sce.R;) 2009/11/12 Hans W Borchers hwborch...@googlemail.com: Simon Seibert simon.seibert at mytum.de writes:

[R] loop through variable names

2009-11-11 Thread Jacob Wegelin
Often I perform the same task on a series of variables in a dataframe, by looping through a character vector that holds the names and using paste(), eval(), and parse() inside the loop. For instance: thesevars-names(environmental) environmental$ToyOutcome-rnorm(nrow(environmental))

Re: [R] loop through variable names

2009-11-11 Thread Gabor Grothendieck
Try this: lm(environmental[c(ToyOutcome, thisvar)]) or lm(ToyOutcome ~., environmental[c(ToyOutcome, thisvar)]) On Wed, Nov 11, 2009 at 6:49 PM, Jacob Wegelin jacobwege...@fastmail.fm wrote: Often I perform the same task on a series of variables in a dataframe, by looping through a

[R] naive collinear weighted linear regression

2009-11-11 Thread Mauricio Calvao
Hi there Sorry for what may be a naive or dumb question. I have the following data: x - c(1,2,3,4) # predictor vector y - c(2,4,6,8) # response vector. Notice that it is an exact, perfect straight line through the origin and slope equal to 2 error - c(0.3,0.3,0.3,0.3) # I have (equal)

Re: [R] Suppressing final spaces in data.frame printouts

2009-11-11 Thread RICHARD M. HEIBERGER
On Wed, Nov 11, 2009 at 8:12 PM, Stavros Macrakis macra...@alum.mit.edu wrote: Thanks for the suggestion. I'mm familiar with the truncate-lines variable, but that's not quite what I was looking for. I don't want the padding spaces displayed, but I do want to see long strings at the end of the

Re: [R] Suppressing final spaces in data.frame printouts

2009-11-11 Thread Stavros Macrakis
Thanks for the suggestion. I'mm familiar with the truncate-lines variable, but that's not quite what I was looking for. I don't want the padding spaces displayed, but I do want to see long strings at the end of the line. Thanks anyway, -s On Wed, Nov 11, 2009 at 5:40 PM, Richard

  1   2   >