Re: [R] Merging vector data into one file

2010-01-31 Thread Dieter Menne
Altaweel, Mark R. wrote: > > > I had another question. If you had say a vector (e.g., called data) > with 235 elements and each element looked like the following > > data[[1]] > Column A-BColumn Z-SColumn A-S > 1 25 ... > > > da

Re: [R] Installling source package

2010-01-31 Thread Prof Brian Ripley
Most likely you have a corrupted tarball, so I would compare its size with that on the CRAN master (which to me looks like 680366 bytes). Note though that you need to get XML to work on Windows - to get appropriate versions of libxml2 and its dependencies iconv and zlib. - to make changes to

[R] Hierarchical data sets: which software to use?

2010-01-31 Thread Anton du Toit
Dear R-helpers, I’m writing for advice on whether I should use R or a different package or language. I’ve looked through the R-help archives, some manuals, and some other sites as well, and I haven’t done too well finding relevant info, hence my question here. I’m working with hierarchical data (

[R] Merging vector data into one file

2010-01-31 Thread Mark Altaweel
Hi, I had another question. If you had say a vector (e.g., called data) with 235 elements and each element looked like the following data[[1]] Column A-BColumn Z-SColumn A-S 1 25 ... data[[2]] Column Z-BColumn A-SColumn

Re: [R] Using apply function on duplicates in a data.frame

2010-01-31 Thread Sunny Srivastava
Thanks a lot. All the three approaches work for me! On Sun, Jan 31, 2010 at 10:43 PM, hadley wickham wrote: > On Sun, Jan 31, 2010 at 5:05 PM, Sunny Srivastava > wrote: > > Dear R-Helpers, > > I have a data.frame (df) and the head of data.frame looks like > > > > ProbeUID ControlType Pr

[R] How to globally enable warning messages or stop the program if NA is encountered?

2010-01-31 Thread Peng Yu
By default, my R functions run silently if NA is encountered? I would like them to give me some message when NA is encountered by default. Note that I could check each intermediate variable by something like is.na(). But this is not manageable for big programs, so I'd like a way to check NA global

Re: [R] Dear professor

2010-01-31 Thread Frank E Harrell Jr
This is the R-help list, not the list for S-Plus. And note that you are using a 6 year old version of the Design library. Note that if you ever use R, use the rms package in place of Design. Frank Tian Xu wrote: > Dear professor: > > When I used s-plus to run a Buckley-James Multiple Regressio

Re: [R] Using apply function on duplicates in a data.frame

2010-01-31 Thread hadley wickham
On Sun, Jan 31, 2010 at 5:05 PM, Sunny Srivastava wrote: > Dear R-Helpers, > I have a data.frame (df) and the head of data.frame looks like > >     ProbeUID ControlType     ProbeName GeneName SystematicName > 1665     1577           0 pSysX_50_22_1 pSysX_50       pSysX_50 > 5422     5147          

Re: [R] String Comparison

2010-01-31 Thread Jorge Ivan Velez
How about union() ? > a <- as.character(c("a", "b", "c", "d", "e")) > b <- as.character(c("d", "a", "c", "e", "f", "b")) > > union(a,b) [1] "a" "b" "c" "d" "e" "f" HTH, Jorge On Sun, Jan 31, 2010 at 10:31 PM, stephen sefick <> wrote: > a <- as.character(c("a", "b", "c", "d", "e")) > b <- as.cha

Re: [R] Loading data from folder [SEC=UNCLASSIFIED]

2010-01-31 Thread Augusto.Sanabria
Hi Mark, You can use: all_files <- dir(pattern="Data") One_file <- all_files[1] Is this what you want? Cheers, Augusto Augusto Sanabria. MSc, PhD. Mathematical Modeller Risk & Impact Analysis Group Geospatial & Earth Monitoring Division Geoscience A

[R] String Comparison

2010-01-31 Thread stephen sefick
a <- as.character(c("a", "b", "c", "d", "e")) b <- as.character(c("d", "a", "c", "e", "f", "b")) How would I get a list of only the unique values of these two character vectors. I would like the output a b c d e f there is no reason to have these in order. I am looking at to character vectors of

Re: [R] Loading data from folder

2010-01-31 Thread Mark Altaweel
Hi, looks like the list.files() method was the key to my problem. With that, I was able to just loop through the "files" variable and get the file names to load Thanks for your help. Mark On Jan 31, 2010, at 8:23 PM, jim holtman wrote: Something like the following might work. YOu can use

Re: [R] Loading data from folder

2010-01-31 Thread jim holtman
Something like the following might work. YOu can use 'choose.dir()' to get the directory: files <- list.files(path=yourDir) result <- do.call(rbind, lapply(files, read.csv)) On Sun, Jan 31, 2010 at 9:10 PM, Mark Altaweel wrote: > Hi, > > I am trying to load csv type data from a folder. However,

Re: [R] Is there a way to make blocks of code independent from each other?

2010-01-31 Thread jim holtman
Use 'local' > x <- 1 > local({ + x <- 3 + print(x) + }) [1] 3 > print(x) [1] 1 > > On Sun, Jan 31, 2010 at 8:56 PM, Peng Yu wrote: > I'm wondering if there is a way to make blocks of code independent > from each other. Please see the following example for what I mean. > > x=1 > > ## is

[R] Loading data from folder

2010-01-31 Thread Mark Altaweel
Hi, I am trying to load csv type data from a folder. However, rather than syntax that simply loads one file at a time I was wondering if there is a method that loads all data from a specific folder. For instance, I have the following data files in a folder nebraskaStats: 10-1-2009_10-7-2009.

Re: [R] Is there a way to make blocks of code independent from each other?

2010-01-31 Thread Jeff Laake
Put in a function what you would have put in the {} and execute the function x=1 myf=function() { x=3 do something with new value of x ... } myf() print(x) # it will be 1 On 1/31/2010 5:56 PM, Peng Yu wrote: I'm wondering if there is a way to make blocks of code independent from each ot

[R] Is there a way to make blocks of code independent from each other?

2010-01-31 Thread Peng Yu
I'm wondering if there is a way to make blocks of code independent from each other. Please see the following example for what I mean. x=1 ## is there a way to make the following assignment not affect the above x? ## in C++, I can use {} to make the effect local. Is there an equivalent construct i

Re: [R] (With trepidation): Evaluating expressions with sub expressions again

2010-01-31 Thread Bert Gunter
Thankyou Thomas. Yes, I was motivated by bquote(). It is so slick (to some extent, still too slick for me). I wanted to do it nonrecursively because it's both clearer (I think) and maybe even more efficient (though I doubt this is detectable in any case). Bert Gunter Genentech Nonclinical Sta

Re: [R] Installling source package [SEC=UNCLASSIFIED]

2010-01-31 Thread Augusto.Sanabria
Steven, Package 'XML_2.6-0.tar.gz' is the Linux version, it doesn't unpack in Windows. For Windows you need to download and instal: 'XML_2.6-0.zip'. Which is available from: http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.10/ Cheers, Augusto

Re: [R] combining data frames in a list - how do I add breaks?

2010-01-31 Thread Euan Reavie
With Jim's help, the solution is as follows... -Original Message- From: jim holtman [mailto:jholtman * at sign * gmail.com] Sent: Sunday, January 31, 2010 5:41 PM To: Euan Reavie Subject: Re: [R] combining data frames in a list - how do I add breaks? Your 'combined' was a 'list of a list

Re: [R] ggplot2: ... seem to be overwriting each other

2010-01-31 Thread Eric Fail
Hi Dennis (cc Lucien Lemmens and the r-help) Thank you for your help. I got help from Mr. Lucien Lemmens as well, and thanks to him to (again). The thing is, if, my working example, is run line by line, it overwrites ... or one thing overwrites the next. However both you and Lucien Lemmens

[R] Installling source package

2010-01-31 Thread Steven Kang
Hi R users, Im trying to install XML source package (in window platform) using the following command. *install.packages(pkgs = "C:\\Documents and Settings\\skang\\Desktop\\Softwares\\R\\Library\\XML_2.6-0.tar.gz", repos = NULL, type = "source")* and get the following result. gzip: stdin: unexpec

Re: [R] Using apply function on duplicates in a data.frame

2010-01-31 Thread David Winsemius
On Jan 31, 2010, at 6:05 PM, Sunny Srivastava wrote: Dear R-Helpers, I have a data.frame (df) and the head of data.frame looks like ProbeUID ControlType ProbeName GeneName SystematicName 1665 1577 0 pSysX_50_22_1 pSysX_50 pSysX_50 5422 5147 0 pSysX_49

[R] Using apply function on duplicates in a data.frame

2010-01-31 Thread Sunny Srivastava
Dear R-Helpers, I have a data.frame (df) and the head of data.frame looks like ProbeUID ControlType ProbeName GeneName SystematicName 1665 1577 0 pSysX_50_22_1 pSysX_50 pSysX_50 5422 5147 0 pSysX_49_8_1 pSysX_49 pSysX_49 4042 3843 0 p

Re: [R] (With trepidation): Evaluating expressions with sub expressions again

2010-01-31 Thread Thomas Lumley
On Sun, 31 Jan 2010, Bert Gunter wrote: (For R language geeks only) Folks: I think the best solution for the issue in the Subject line(see 29 January thread on this for details) was the one Jennifer and Gabor previously arrived at: (essentially)don't use R; instead, use a computer algebra syst

Re: [R] Solving an optimization problem: selecting an "optimal" subset

2010-01-31 Thread Erwin Kalvelagen
Dimitri Shvorob gmail.com> writes: > > > Thank you very much, Erwin. If I may ask some follow-up questions > 1. GAMS <> R, ad it's just not entirely clear how to move the soltion to R. > (At most trivial, how do I "bring in" the subsettable vector into the > solver?") > 2. "The quadratic object

[R] Help with R in ubuntu (more organized 2)

2010-01-31 Thread Kenneth Roy Cabrera Torres
Dear R users: Maybe it is a silly question, but I'm don't understand what am I doing wrong. In a new karmik koala ubuntu installation I compile the last patched 2.10.1 version of R. Every thing was right (I install all the dev libraries I need). First I type: ./configure --enable-R-shlib And

[R] Help with R in ubuntu (more organized)

2010-01-31 Thread KENNETH R CABRERA
Dear R users: Maybe it is a silly question, but I'm don't understand what am I doing wrong. In a new karmik koala ubuntu installation I compile the last patched 2.10.1 version of R. Every thing was right (I install all the dev libraries I need). First I type: ./configure --enable-R-shlib An

[R] Help with R in ubuntu

2010-01-31 Thread KENNETH R CABRERA
Dear R users: Maybe it is a silly question, but I'm don't understand what am I doing wrong. In a new karmik koala ubuntu installation I compile the last patched 2.10.1 version of R. Every thing was right (I install all the dev libraries I need). First I type: ./configure --enable-R-shlib An

Re: [R] ggplot2: ... seem to be overwriting each other

2010-01-31 Thread Ray Brownrigg
While I have never used ggplot2, it looks to me like the minimal reproducible code that replicates your "problem" is: plot <- 1 plot + 2 plot + 3 HTH Ray Brownrigg On Mon, 01 Feb 2010, Eric Fail wrote: > Dear list > > A week ago Dennis Murphy helped me out by showing me some nice ggplot2 > tri

[R] ggplot2: ... seem to be overwriting each other

2010-01-31 Thread Eric Fail
Dear list A week ago Dennis Murphy helped me out by showing me some nice ggplot2 tricks . Now I got stuck in a new problem that I can't solve (I have ordered the ggplot2-book). My problem is that I can't add my spline (or geom_smooth) and at the same time control the grid (using scale_x_c

Re: [R] permutation analysis with randomly chosen subsets of a matrix

2010-01-31 Thread David Winsemius
On Jan 31, 2010, at 2:19 PM, Zoppoli, Gabriele (NIH/NCI) [G] wrote: Hello, here is the problem: I want to demonstrate that, on average, the Pearson's correlations of a specified subset of genes from a huge list (>18,000 columns) are higher than any randomly chosen subset of that list. I w

Re: [R] combining data frames in a list - how do I add breaks?

2010-01-31 Thread RICHARD M. HEIBERGER
I have several questions on your goals. Why are you planning to post-processing outside of R? Why use CSV files when there are usually better ways to maintain the structure of the data? Why do you want to flatten your tables? It looks like a three-dimensional array would better capture the info

Re: [R] How to split data frame into groups by a list of factors?

2010-01-31 Thread jim holtman
This seems to work fine for me: > x <- read.table(textConnection(" Date trade_day IV.b IV.a + 1 2003-03-0219 0.1724818 0.1815687 + 2 2003-03-0218 0.1733542 0.1763827 + 3 2003-03-0219 0.1753308 0.1783653 + 4 2003-03-0316 0.1751217 0.1781624 + 5 2003-03

Re: [R] combining data frames in a list - how do I add breaks?

2010-01-31 Thread jim holtman
How about posting your complete set of code that is manipulating the list. Normally when I am using a list, each list element is the result from a test/iteration and then I can use something like 'rbind' at the end. I would not expect the output you are getting with the results extending to the r

Re: [R] R performance

2010-01-31 Thread Barry Rowlingson
On Sun, Jan 31, 2010 at 7:55 PM, Marc Jekel wrote: > Dear R Fans, > > I was recently asking myself how quick R is in code execution. R can be a million times quicker than C code. Badly written C code. Next question... > I have been > running simulations lately that need quite a time for executi

[R] (With trepidation): Evaluating expressions with sub expressions again

2010-01-31 Thread Bert Gunter
(For R language geeks only) Folks: I think the best solution for the issue in the Subject line(see 29 January thread on this for details) was the one Jennifer and Gabor previously arrived at: (essentially)don't use R; instead, use a computer algebra system that you can access through an R interfa

[R] combining data frames in a list - how do I add breaks?

2010-01-31 Thread Euan Reavie
I'm a week-old R user, and have become stuck trying to create usable CSV outputs for post-processing. I am using the package Rioja, which provides small datasets of results. I am running several analyses in a loop and iteratively adding the results to a *list* ("combined"). Within each iteration I

[R] R performance

2010-01-31 Thread Marc Jekel
Dear R Fans, I was recently asking myself how quick R is in code execution. I have been running simulations lately that need quite a time for execution and I was wondering if it is reasonable at all to do more computational extensive projects with R. Of course, it is possible to compare execu

[R] How to split data frame into groups by a list of factors?

2010-01-31 Thread 曾振兴
Dear R users: I am dealing a data frame x as followings: Date trade_day IV.b IV.a 1 2003-03-0219 0.1724818 0.1815687 2 2003-03-0218 0.1733542 0.1763827 3 2003-03-0219 0.1753308 0.1783653 4 2003-03-0316 0.1751217 0.1781624 5 2003-03-0316 0.

[R] permutation analysis with randomly chosen subsets of a matrix

2010-01-31 Thread Zoppoli, Gabriele (NIH/NCI) [G]
Hello, here is the problem: I want to demonstrate that, on average, the Pearson's correlations of a specified subset of genes from a huge list (>18,000 columns) are higher than any randomly chosen subset of that list. I would therefore like to do a number of tests between that specified subset

Re: [R] Reshaping matrix of vectors as dataframe

2010-01-31 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Oliver Gondring > Sent: Sunday, January 31, 2010 6:53 AM > To: r-help@r-project.org > Subject: [R] Reshaping matrix of vectors as dataframe > > Dear R people, > > I have to dea

Re: [R] RBloomberg on Mac Leopard

2010-01-31 Thread David Winsemius
What made you think it was available for the Mac? The R-forge page says: • Intended Audience: Developers • License: GNU General Public License (GPL) • Natural Language: English • Operating System: Windows • Programming Language: R • Topic: Data and

Re: [R] Reshaping matrix of vectors as dataframe

2010-01-31 Thread David Winsemius
On Jan 31, 2010, at 9:53 AM, Oliver Gondring wrote: Dear R people, I have to deal with the output of a function which comes as a matrix of vectors. If that is so, then the object below does not represent it, because that is a matrix of _lists_. You can reproduce the structure as given

Re: [R] FracSim set.seed

2010-01-31 Thread Peter Ehlers
I think you may be out of luck. The randomization is in the C-code of the function. You could recode that and build your own version of the package. Or perhaps the authors would be receptive to a request to make a suitable change. -Peter Ehlers Selwyn McCracken wrote: Hi, I am using the FracS

[R] linear models with variance in dependent and independent variables

2010-01-31 Thread Julian Burgos
Dear list, I need to fit a multiple regression in which individual data point in the independent and the dependent variables have an associated variance or standard deviation. To make things clear, instead of having just a table of dependent (X) and independent (Y1, Y2) variable values like this:

[R] RBloomberg on Mac Leopard

2010-01-31 Thread Lucio Intelligente
Hi, I'm running R 2.10.1 GUI 1.31 Leopard build 64-bit (5537). I cannot install RBloomberg on my Mac. After I type: install.packages("RBloomberg", repos="http://R-Forge.R-project.org";) I get the following message: Warning in install.packages("RBloomberg", repos = "http://R-Forge.R-project.o

Re: [R] Solving an optimization problem: selecting an "optimal" subset

2010-01-31 Thread Dimitri Shvorob
> To replace an absolute value by two binary variables is an old trick in optimization modeling. I am having trouble Googling it: can anyone suggest a reference, or just explain? Thank you. -- View this message in context: http://n4.nabble.com/Solving-an-optimization-problem-selecting-an-optim

Re: [R] Solving an optimization problem: selecting an "optimal" subset

2010-01-31 Thread Dimitri Shvorob
Thank you very much, Erwin. If I may ask some follow-up questions 1. GAMS <> R, ad it's just not entirely clear how to move the soltion to R. (At most trivial, how do I "bring in" the subsettable vector into the solver?") 2. "The quadratic objective can be replaced by a linear one by minimizing th

[R] Package ismev, gpd.fit, and interpretation for statistics of extreme values

2010-01-31 Thread Changyou Sun
Dear All, I have a question about package "ismev", its function "gpd.fit", and interpretation of the results. I used the package ismev to do an extreme value analysis on a fire dataset. Two variables are used in the analysis. The focal variable is acreage burned per fire, ranging from 1 to

[R] Reshaping matrix of vectors as dataframe

2010-01-31 Thread Oliver Gondring
Dear R people, I have to deal with the output of a function which comes as a matrix of vectors. You can reproduce the structure as given below: x <- list(c(1,2,4),c(1,3,5),c(0,1,0), c(1,3,6,5),c(3,4,4,4),c(0,1,0,1), c(3,7),c(1,2),c(0,1)) data <- matrix(x,byrow=TRUE,nrow=3)

Re: [R] RCurl : limit of downloaded Urls ?

2010-01-31 Thread Duncan Temple Lang
Alexis-Michel Mugabushaka wrote: > Dear Rexperts, > > I am using R to query google. I believe that Google would much prefer that you use their API rather than their regular HTML form to make programmatica search queries. > > I am getting different results (in size) for manual queries and que

Re: [R] More than on loop??

2010-01-31 Thread che
hello, i appreciate your help, your help, comments, and suggestion really are so helpful to develop not only my R skills, but also my programming language sense. as i said, i am not breaking any academic rules, and this is a softwar i have to develop to deal with my project after two months along

Re: [R] Solving an optimization problem: selecting an "optimal" subset

2010-01-31 Thread Hans W Borchers
Dimitri Shvorob wrote: > > Same request to Hans: > I am afraid I need a little more spoon-feeding following > >> I sent a GAMS script modeling this problem to the NEOS solvers > > Thanks a lot! > If you have access to CPLEX (I mean the commercial program, not Rcplex which is just an interfa

Re: [R] For loop into a vectorized form?

2010-01-31 Thread johannes rara
Exactly, thanks! -jrara 2010/1/30 David Winsemius : > > On Jan 29, 2010, at 9:31 AM, johannes rara wrote: > >> How to vectorize this for loop and how can I assign result to vector >> instead of using print function? > >> as.vector( sapply(mylist$a, function(x) >                           sapply(m

Re: [R] format

2010-01-31 Thread Bart Joosen
maybe you are looking for: format(x,drop0trailing=TRUE) Bart -- View this message in context: http://n4.nabble.com/format-tp1457899p1457952.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat

Re: [R] accessing column and row numbers inside splom in lattice

2010-01-31 Thread Dieter Menne
Roger Levy-2 wrote: > > When using splom() in the lattice package, I would like to be able to > access the row and column number of each individual pairs plot , > I found this rather tricky, but Deepayan's http://markmail.org/message/mxbevsxc5orbweu6 might help. Dieter -- View this

[R] RCurl : limit of downloaded Urls ?

2010-01-31 Thread Alexis-Michel Mugabushaka
Dear Rexperts, I am using R to query google. I am getting different results (in size) for manual queries and queries sent through "getForm" of RCurl. It seems that RCurl limits the size of the text retrieved (the maximum I could get is around 32 k bits). Any idea how to get around this ? Than

Re: [R] drawing a line that shifts from solid to broken

2010-01-31 Thread Jim Lemon
On 01/31/2010 02:33 AM, Jamie Smith wrote: I am graphing longitudinal data from three time points. I'd like to draw a solid line from point 1 to point 2, and then a dashed line from point 2 to point 3. It works if I do it in two steps: first.vector<- c(mean(year1$variable1), mean(year2$variable

Re: [R] format

2010-01-31 Thread Bart Joosen
how about round? ?round -- View this message in context: http://n4.nabble.com/format-tp1457899p1457938.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] graph help

2010-01-31 Thread Jim Lemon
On 01/31/2010 07:04 AM, Rob Manley wrote: Hello, I'm fairly new to R and having trouble displaying my data graphically to a publishable quality. I have a multivariate data-set (columns all the same length), 8 environmental variables and 3 species diversity variables. I'm simply trying to display

Re: [R] help on Venn's diagram

2010-01-31 Thread Jim Lemon
On 01/31/2010 02:13 PM, Zoppoli, Gabriele (NIH/NCI) [G] wrote: Hello! I have this problem: I want to create a Venn's diagram with three lists of genes'names. The first is all the genome, the second a subset of it comprising all mitochondrial genes, and the third including all genes that correl