Re: [R] Need help on Newton-Raphson optimization

2011-08-10 Thread Berend Hasselman
michael wrote: > > Hi, > > Is there available package on the optimization function using > Newton-Raphson method (iterative quadratic approximation)? I have been > using > the 'optim' function in R and found it really unstable (it depends heavily > on the initial values and functional forms

Re: [R] Can R handle a matrix with 8 billion entries?

2011-08-10 Thread Chris Howden
Thanks Corey, I’ve looked into them before and I don’t think they can help me with this problem. The Big functions are great for handling and analysing data sets that are too big for R to store in memory. However I believe my problem goes 1 step beyond that. In that my distance matrix has too

Re: [R] plotrix update

2011-08-10 Thread Rolf Turner
On 11/08/11 13:19, Jesse Brown wrote: I've run across what I think is a small bug in the plotrix package. I've tried to contact the maintainer (Jim Lemon) directly but email is returned 'undeliverable' at the provided address. What is the best method to push a patch to a CRAN package in this case

Re: [R] font (charter)

2011-08-10 Thread ivo welch
this may help others. among the set of font resources are the following: http://yihui.name/en/2010/03/font-families-for-the-r-pdf-device/ http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/postscriptFonts.html http://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/embedFonts.html

[R] Data frame to list?

2011-08-10 Thread Jonathan Greenberg
R-helpers: Is there an easy way to transfer a data frame to a list, where each list element is a dataframe containing a single row from the original data frame? --j -- Jonathan A. Greenberg, PhD Assistant Project Scientist Center for Spatial Technologies and Remote Sensing (CSTARS) Department o

[R] plotrix update

2011-08-10 Thread Jesse Brown
I've run across what I think is a small bug in the plotrix package. I've tried to contact the maintainer (Jim Lemon) directly but email is returned 'undeliverable' at the provided address. What is the best method to push a patch to a CRAN package in this case? Thank you, Jesse __

Re: [R] Data frame to list?

2011-08-10 Thread Jonathan Greenberg
Answered my own question. ?split Never mind! --j On Wed, Aug 10, 2011 at 7:35 PM, Jonathan Greenberg wrote: > R-helpers: > > Is there an easy way to transfer a data frame to a list, where each > list element is a dataframe containing a single row from the original > data frame? > > --j > > --

Re: [R] Question about NULL matrix? Can I define a NULL matrix in R?

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 10:03 PM, Rolf Turner wrote: On 11/08/11 13:27, David Winsemius wrote: On Aug 10, 2011, at 9:22 PM, Rolf Turner wrote: On 11/08/11 13:11, David Winsemius wrote: On Aug 10, 2011, at 8:23 PM, Andra Isan wrote: Hi All, I would like to create a matrix in R but I dont kno

Re: [R] Question about NULL matrix? Can I define a NULL matrix in R?

2011-08-10 Thread Rolf Turner
On 11/08/11 13:27, David Winsemius wrote: On Aug 10, 2011, at 9:22 PM, Rolf Turner wrote: On 11/08/11 13:11, David Winsemius wrote: On Aug 10, 2011, at 8:23 PM, Andra Isan wrote: Hi All, I would like to create a matrix in R but I dont know the size of my matrix. I only know the size of th

Re: [R] using if then statements in a dataframe

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 7:34 PM, Ward, Michael Patrick wrote: I used this service several months ago and was very pleased with the response. I have a dataframe with several thousand lines and to each line I need to apply a series of "if else" statements. For each row I need either a value

Re: [R] using if then statements in a dataframe

2011-08-10 Thread Weidong Gu
Mike, One thing I noticed that '&&' should be replaced by '&'. The former is applied to the first element of the vector while the latter applicable to the whole vector. HTH Weidong Gu On Wed, Aug 10, 2011 at 7:34 PM, Ward, Michael Patrick wrote: > > I used this service several months ago and

Re: [R] Question about NULL matrix? Can I define a NULL matrix in R?

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 9:22 PM, Rolf Turner wrote: On 11/08/11 13:11, David Winsemius wrote: On Aug 10, 2011, at 8:23 PM, Andra Isan wrote: Hi All, I would like to create a matrix in R but I dont know the size of my matrix. I only know the size of the columns but not the size of the rows.

Re: [R] Question about NULL matrix? Can I define a NULL matrix in R?

2011-08-10 Thread Rolf Turner
On 11/08/11 13:11, David Winsemius wrote: On Aug 10, 2011, at 8:23 PM, Andra Isan wrote: Hi All, I would like to create a matrix in R but I dont know the size of my matrix. I only know the size of the columns but not the size of the rows. So, is there any way to create a dynamic matrix of si

Re: [R] Question about NULL matrix? Can I define a NULL matrix in R?

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 8:23 PM, Andra Isan wrote: Hi All, I would like to create a matrix in R but I dont know the size of my matrix. I only know the size of the columns but not the size of the rows. So, is there any way to create a dynamic matrix of size NULL by n_cols? and then add to that

[R] using if then statements in a dataframe

2011-08-10 Thread Ward, Michael Patrick
I used this service several months ago and was very pleased with the response. I have a dataframe with several thousand lines and to each line I need to apply a series of "if else" statements. For each row I need either a value or a blank/NA. Below is the series of if else statements I have bee

[R] Question about NULL matrix? Can I define a NULL matrix in R?

2011-08-10 Thread Andra Isan
Hi All,  I would like to create a matrix in R but I dont know the size of my matrix. I only know the size of the columns but not the size of the rows. So, is there any way to create a dynamic matrix of size NULL by n_cols? and then add to that matrix? I know for a vector, I can do this: x= NULL

Re: [R] Need help on Newton-Raphson optimization

2011-08-10 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of michael > Sent: Wednesday, August 10, 2011 4:37 PM > To: r-help@r-project.org > Subject: [R] Need help on Newton-Raphson optimization > > Hi, > > Is there available package

Re: [R] Need help on Newton-Raphson optimization

2011-08-10 Thread Rolf Turner
On 11/08/11 11:36, michael wrote: Hi, Is there available package on the optimization function using Newton-Raphson method (iterative quadratic approximation)? I have been using the 'optim' function in R and found it really unstable (it depends heavily on the initial values and functional f

[R] Need help on Newton-Raphson optimization

2011-08-10 Thread michael
Hi, Is there available package on the optimization function using Newton-Raphson method (iterative quadratic approximation)? I have been using the 'optim' function in R and found it really unstable (it depends heavily on the initial values and functional forms). If I have to code it by myself

Re: [R] Clustering Large Applications..sort of

2011-08-10 Thread Christian Hennig
PS to my previous posting: Also have a look at kmeansruns in fpc. This runs kmeans for several numbers of clusters and decides the number of clusters by either Calinski&Harabasz or Average Silhouette Width. Christian On Wed, 10 Aug 2011, Ken Hutchison wrote: Hello all, I am using the clust

Re: [R] Clustering Large Applications..sort of

2011-08-10 Thread Christian Hennig
There is a number of methods in the literature to decide the number of clusters for k-means. Probably the most popular one is the Calinski and Harabasz index, implemented as calinhara in package fpc. A distance based version (and several other indexes to do this) is in function cluster.stats in

[R] Setting X-Axis labels in Lattice Barchart

2011-08-10 Thread Gregory Sawyer
Hello, I'm attempting to plot out a series of bar charts of recency, frequency and monetary (RFM) scores using recency as a conditioning variable so we can see the details of the FM components. My dataset looks like this: rfmCellPop{rfm_score, orecency, ofrequency, omonetary, cellpop} Where r

Re: [R] convert R plots into annotated web-graphics

2011-08-10 Thread danreb
Hi, Does anyone have feed back on using flot (javascript plotting library) for R data (e.g. ggplot2) visualisation on the web? Thanks for your comments, -- View this message in context: http://r.789695.n4.nabble.com/convert-R-plots-into-annotated-web-graphics-tp1471984p3734407.html Sent fro

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread peter dalgaard
On Aug 10, 2011, at 23:39 , David Winsemius wrote: > Hopefully this expected invitation to grilling will not result in severe > burns. I note that one of the *apply family would have been successful in > returning the desired object in conjunction with c() : > > > rapply(x, c) > [1] "a" "b" "c

Re: [R] Sequential Naming of ggplot .pngs using plyr

2011-08-10 Thread Justin Haynes
Thanks Ista, In my real code that is exactly what I'm doing, but I want to prepend the names with a sequential number for easier reference once the pngs are made. My initial thought was to add the sequential number to the data before sending it to plyr and drawing it out there, but that seems lik

[R] GAM Prediction

2011-08-10 Thread Gene Leynes
I'm looking for the best way to do the following: run a set of GAM models, and then make predictions with new data. My problem is the size of the gam model object, I would like to strip it down to the bare minimum of information needed to apply the model to new data. For example, if this wer

Re: [R] Sequential Naming of ggplot .pngs using plyr

2011-08-10 Thread Ista Zahn
Hi Justin, On Wed, Aug 10, 2011 at 5:04 PM, Justin Haynes wrote: > If I have data: > > dat<-data.frame(a=rnorm(20),b=rnorm(20),c=rnorm(20),d=rnorm(20),site=rep(letters[5:8],each=5)) > > And want to plot like this: > > ctr<-1 > for(i in c('a','b','c','d')){ >    png(file=paste('/tmp/plot_number_',

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 3:58 PM, Liviu Andronic wrote: On Wed, Aug 10, 2011 at 9:32 PM, David Winsemius > wrote: Thanks all! This is perfect, and very R-ish: never where a novice would expect it to be. Well, since `unlist` is linked in the See Also on the help page for `list`, I can only hope

Re: [R] Reading XML files masquerading as XL files

2011-08-10 Thread Duncan Temple Lang
Hi Dennis That those files are in a directory/folder suggests that they were extracted from their zip (.xlsx) file. The following are the basic contents of the .xlsx file 1484 02-28-11 12:48 [Content_Types].xml 733 02-28-11 12:48 _rels/.rels 972 02-28-11 12:48 xl/_rels

Re: [R] Clustering Large Applications..sort of

2011-08-10 Thread Peter Langfelder
On Wed, Aug 10, 2011 at 12:07 PM, Ken Hutchison wrote: > Hello all, >   I am using the clustering functions in R in order to work with large > masses of binary time series data, however the clustering functions do not > seem able to fit this size of practical problem. Library 'hclust' is good > (t

[R] Sequential Naming of ggplot .pngs using plyr

2011-08-10 Thread Justin Haynes
If I have data: dat<-data.frame(a=rnorm(20),b=rnorm(20),c=rnorm(20),d=rnorm(20),site=rep(letters[5:8],each=5)) And want to plot like this: ctr<-1 for(i in c('a','b','c','d')){ png(file=paste('/tmp/plot_number_',ctr,'.png',sep=''),height=8.5, width=11,units='in',pointsize=9,res=300) print

Re: [R] Source Code glm() question

2011-08-10 Thread Thomas Lumley
On Wed, Aug 10, 2011 at 11:25 PM, ONKELINX, Thierry wrote: > Just type glm at the prompt. > Typing glm.fit at the prompt will probably be more informative. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland __ R-help@r-pr

Re: [R] choosing selective data with permutations

2011-08-10 Thread Dennis Murphy
Hi: Your R terminology needs a little work, but I think this is what you're after: # read your example data from e-mail into an R session dd <- read.table(textConnection(" Ind1 11 00 12 15 28 Ind2 21 33 22 67 52 Ind3 22 45 21 22 56 Ind4 11 25 74 77 42 Ind5 41 32 67 45 22"), header

Re: [R] Clustering Large Applications..sort of

2011-08-10 Thread Thomas Lumley
Try the flow cytometry clustering functions in Bioconductor. -thomas On Thu, Aug 11, 2011 at 7:07 AM, Ken Hutchison wrote: > Hello all, >   I am using the clustering functions in R in order to work with large > masses of binary time series data, however the clustering functions do not > see

[R] font (charter)

2011-08-10 Thread ivo welch
dear R-experts---can someone please refer me to the latest installation instructions for graphics fonts in R (the pdf device)? (I would like to install the Charter font from the texlive 2011 distribution under OSX.) sincerely, /iaw Ivo Welch (ivo.we...@gmail.com) ___

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread Liviu Andronic
On Wed, Aug 10, 2011 at 9:32 PM, David Winsemius wrote: >> Thanks all! This is perfect, and very R-ish: never where a novice >> would expect it to be. > > Well, since `unlist` is linked in the See Also on the help page for `list`, > I can only hope you meant that in complete jest. > More or less.

Re: [R] How to quickly convert a data.frame into a structure of lists

2011-08-10 Thread William Dunlap
Here is code to transform the matrix that by() or array(split()) produces, along with an example of the speed of the various approaches. Using split(), either directly or via by() or tapply(), saves a lot of time. f0 <- function(df) { # original code with typos fixed. list_structure <- la

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 3:10 PM, Liviu Andronic wrote: On Wed, Aug 10, 2011 at 9:02 PM, R. Michael Weylandt wrote: unlist() Thanks all! This is perfect, and very R-ish: never where a novice would expect it to be. Well, since `unlist` is linked in the See Also on the help page for `list`, I

Re: [R] xtable - caption missing with float=FALSE

2011-08-10 Thread Marc Schwartz
On Aug 10, 2011, at 2:02 PM, Zev Ross wrote: > Hi, > > For some reason I'm finding that my table caption is disappearing if I print > xtable output with the floating argument set to FALSE. Below is a very simple > Sweave file that produces two tables the first has no caption and the second > h

Re: [R] choosing selective data with permutations

2011-08-10 Thread R. Michael Weylandt
Sorry, that second line of code won't work: do it in 2. f <- function() {return(sample(1:5,3,replace=T/F))} replicate(100,f()) Michael On Wed, Aug 10, 2011 at 3:06 PM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > To pick random elements to sample, you can just use the sample func

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread Liviu Andronic
On Wed, Aug 10, 2011 at 9:02 PM, R. Michael Weylandt wrote: > unlist() > Thanks all! This is perfect, and very R-ish: never where a novice would expect it to be. Cheers Liviu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-

[R] Clustering Large Applications..sort of

2011-08-10 Thread Ken Hutchison
Hello all, I am using the clustering functions in R in order to work with large masses of binary time series data, however the clustering functions do not seem able to fit this size of practical problem. Library 'hclust' is good (though it may be sub par for this size of problem, thus doubly poo

Re: [R] choosing selective data with permutations

2011-08-10 Thread R. Michael Weylandt
To pick random elements to sample, you can just use the sample function sample(1:5,3,replace=T/F) # pick true or false as needed for your data. If you replicate this, you should have no problem. replicate(100,function() return(sample(1:5,3,replace=T/F))) This will be plenty fast, but if you get

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread Jean V Adams
unlist(x) r-help-boun...@r-project.org wrote on 08/10/2011 01:58:57 PM: > [image removed] > > [R] convert 'list' to 'vector'? > > Liviu Andronic > > to: > > r-help@r-project.org Help > > 08/10/2011 02:02 PM > > Sent by: > > r-help-boun...@r-project.org > > Dear all > How does one conver

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread Dimitris Rizopoulos
Check function unlist(). Best, Dimitris On 8/10/2011 8:58 PM, Liviu Andronic wrote: Dear all How does one convert a "non-symmetric" list to a vector? See below: x<- list() x[[1]]<- letters[1:5] x[[2]]<- letters[6:10] x[[3]]<- letters[11:12] x [[1]] [1] "a" "b" "c" "d" "e" [[2]] [1] "f" "g

[R] xtable - caption missing with float=FALSE

2011-08-10 Thread Zev Ross
Hi, For some reason I'm finding that my table caption is disappearing if I print xtable output with the floating argument set to FALSE. Below is a very simple Sweave file that produces two tables the first has no caption and the second has a caption (if you want to see it http://www.zevross.c

Re: [R] convert 'list' to 'vector'?

2011-08-10 Thread R. Michael Weylandt
unlist() Michael Weylandt On Wed, Aug 10, 2011 at 2:58 PM, Liviu Andronic wrote: > Dear all > How does one convert a "non-symmetric" list to a vector? See below: > > > x <- list() > > x[[1]] <- letters[1:5] > > x[[2]] <- letters[6:10] > > x[[3]] <- letters[11:12] > > x > [[1]] > [1] "a" "b" "c"

[R] choosing selective data with permutations

2011-08-10 Thread Vikram Chhatre
Hello, I am a R beginner and hoping to obtain some hints or suggestions about using permutations to sort a data set I have. Here is an example dataset: Ind1 11 00 12 15 28 Ind2 21 33 22 67 52 Ind3 22 45 21 22 56 Ind4 11 25 74 77 42 Ind5 41 32 67 45 22 This will

[R] convert 'list' to 'vector'?

2011-08-10 Thread Liviu Andronic
Dear all How does one convert a "non-symmetric" list to a vector? See below: > x <- list() > x[[1]] <- letters[1:5] > x[[2]] <- letters[6:10] > x[[3]] <- letters[11:12] > x [[1]] [1] "a" "b" "c" "d" "e" [[2]] [1] "f" "g" "h" "i" "j" [[3]] [1] "k" "l" > paste(x) [1] "c(\"a\", \"b\", \"c\", \"d\"

Re: [R] function runif in for loop

2011-08-10 Thread Bert Gunter
Duncan: Yup, you're right. Can't assign, just print. -- Bert On Wed, Aug 10, 2011 at 11:02 AM, Duncan Murdoch wrote: > On 10/08/2011 1:16 PM, Bert Gunter wrote: >> >> Duncan et. al: >> >> Inline below. >> >> On Wed, Aug 10, 2011 at 9:48 AM, Duncan Murdoch >>  wrote: >> >  On 10/08/2011 9:40 AM

Re: [R] Opposite of paste function

2011-08-10 Thread Doran, Harold
The see also potion of paste gives you the functions you can use for this > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Soyeon Kim > Sent: Wednesday, August 10, 2011 2:22 PM > To: r-help@r-project.org > Subject: [R] Opposite

Re: [R] Opposite of paste function

2011-08-10 Thread Abhijit Dasgupta
or, gsub('V','',vn) On 8/10/2011 2:23 PM, Peter Langfelder wrote: > On Wed, Aug 10, 2011 at 11:22 AM, Soyeon Kim wrote: >> Dear All, >> >> I have vn variable >>> vn >> [1] "V300" "V376" >> What I want to get is >> 300 376 > as.numeric(substring(vn, 2)) > > HTH > > Peter > > _

Re: [R] Opposite of paste function

2011-08-10 Thread Peter Langfelder
On Wed, Aug 10, 2011 at 11:22 AM, Soyeon Kim wrote: > Dear All, > > I have vn variable >> vn > [1] "V300" "V376" > What I want to get is > 300 376 as.numeric(substring(vn, 2)) HTH Peter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

[R] Opposite of paste function

2011-08-10 Thread Soyeon Kim
Dear All, I have vn variable > vn [1] "V300" "V376" What I want to get is 300 376 without V and "" from vn variable. Could you help me about this issue? Thank you, Soyeon [[alternative HTML version deleted]] __ R-help@r-project.org mailing l

Re: [R] Histograms in R

2011-08-10 Thread Jean V Adams
Assuming your data is in a data.frame called df, try this: attach(df) TR.groups <- cut(TvarRatio, seq(0.07, 0.11, 0.01)) m <- table(Mutation_Status, TR.groups) mut.no <- dim(m)[1] barplot(m, col=seq(mut.no), xlab="TvarRatio", ylab="Frequency") legend("topleft", dimnames(m)[[1]], fill=seq(mut.no),

Re: [R] function runif in for loop

2011-08-10 Thread Duncan Murdoch
On 10/08/2011 1:16 PM, Bert Gunter wrote: Duncan et. al: Inline below. On Wed, Aug 10, 2011 at 9:48 AM, Duncan Murdoch wrote: > On 10/08/2011 9:40 AM, Johannes Radinger wrote: >> >> Jean, >> >> thank you for your answer. >> especially the line X<- numeric(length(lT)) helped me a lot. >> >

Re: [R] Histograms in R

2011-08-10 Thread R. Michael Weylandt
Perhaps you could shade the bars as appropriate? I'm not going to use your data because it's not an easily paste-able but how about this: x = rnorm(100) y = sample(c("A","B"),100,replace=T,prob=c(0.7,0.3)) d = data.frame(level = x, status = y) n = 10 # Number of bins breaks = quantile(d$level, (

[R] Histograms in R

2011-08-10 Thread lt2
HI everyone, I'm plotting a histogram in R and within that histogram i need to demonstrate the percentage of another variable (Percentage of MutStatus) within the bins plotted inthe histogramI don't know how to do that! Data:Validation_Status Mutation_Status TvarRatio WildtypeNone

Re: [R] function runif in for loop

2011-08-10 Thread Bert Gunter
Duncan et. al: Inline below. On Wed, Aug 10, 2011 at 9:48 AM, Duncan Murdoch wrote: > On 10/08/2011 9:40 AM, Johannes Radinger wrote: >> >> Jean, >> >> thank you for your answer. >> especially the line X<- numeric(length(lT)) helped me a lot. >> >> Anyway, in my case I'd like to get a "dynamic"

Re: [R] How to quickly convert a data.frame into a structure of lists

2011-08-10 Thread William Dunlap
I was going to suggest > AB <- df[c("A","B")] > ls2 <- array(split(df$C, AB), dim=sapply(AB, nlevels), dimnames=sapply(AB, levels)) which produces a matrix very similar to what Duncan's by() call produces > ls1 <- by(df$C, df[,1:2], identity) E.g., > ls2[["a","X"]] [1] 1 2 > ls1[["a","

Re: [R] How to quickly convert a data.frame into a structure of lists

2011-08-10 Thread Eik Vettorazzi
Hi Frederic, shouldn't there be an result for the 3rd row as well, eg ls1$b$Y? Maybe this will do what you want? dtf<-within(dtf,index<-factor(A:B)) tapply(dtf$C,dtf$index,list) Hth. Am 10.08.2011 16:30, schrieb Frederic F: > Hello Duncan, > > Here is a small example to illustrate what I am

Re: [R] Can R handle a matrix with 8 billion entries?

2011-08-10 Thread Corey Dow-Hygelund
You might want to look into the packages bigmemory and biganalytics. Corey On Tue, Aug 9, 2011 at 8:38 PM, Chris Howden wrote: > Hi, > > I’m trying to do a hierarchical cluster analysis in R with a Big Data set. > I’m running into problems using the dist() function. > > I’ve been looking at a fe

Re: [R] function runif in for loop

2011-08-10 Thread Duncan Murdoch
On 10/08/2011 9:40 AM, Johannes Radinger wrote: Jean, thank you for your answer. especially the line X<- numeric(length(lT)) helped me a lot. Anyway, in my case I'd like to get a "dynamic" variable or better a function for X. I mean if i try to call X I'd like that this drawing of random numbe

Re: [R] instal tar.gz package on windows

2011-08-10 Thread Duncan Murdoch
On 10/08/2011 11:59 AM, Lippel, Anna wrote: Hi Duncan, I have tried to install a tar.gz package following your instructions (https://stat.ethz.ch/pipermail/r-help/2008-August/169599.html) but without success. Here are the steps I followed: I installed the last version of Rtools and ran Rcmd I

Re: [R] How to quickly convert a data.frame into a structure of lists

2011-08-10 Thread Duncan Murdoch
On 10/08/2011 10:30 AM, Frederic F wrote: Hello Duncan, Here is a small example to illustrate what I am trying to do. # Example data.frame df=data.frame(A=c("a","a","b","b"), B=c("X","X","Y","Z"), C=c(1,2,3,4)) # A B C # 1 a X 1 # 2 a X 2 # 3 b Y 3 # 4 b Z 4 ### First way of getting the list

Re: [R] RExcel

2011-08-10 Thread David Winsemius
Don't they have their own support mailing list? You should review their documentation for specifics. -- David. On Aug 10, 2011, at 12:24 PM, Dr. Alireza Zolfaghari wrote: Hi list, I used to work with RExcel in excel 2003. Now in 2007, I tried the same RExcel, but it did not work. I got R ve

Re: [R] scan(file, encoding=?)

2011-08-10 Thread tibi3000
Hi, this command gives you all possible encoding options on your platform: iconvlist() hope it answers your question, T -- View this message in context: http://r.789695.n4.nabble.com/scan-file-encoding-tp840838p3733327.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] How to quickly convert a data.frame into a structure of lists

2011-08-10 Thread Frederic F
Hello Denis, > To borrow shamelessly from one of the prominent helpers on this list: > "What is the problem you're trying to solve?"    (attribution: Jim Holtman) I'm trying to connect two sets of legacy R tools: the output of the first one can be transformed in a data.frame without loss of inf

Re: [R] function runif in for loop

2011-08-10 Thread Johannes Radinger
Original-Nachricht > Datum: Wed, 10 Aug 2011 09:38:38 -0400 > Von: Duncan Murdoch > An: Johannes Radinger > CC: r-help@r-project.org > Betreff: Re: [R] function runif in for loop > On 10/08/2011 7:28 AM, Johannes Radinger wrote: > > Hello, > > > > I'd like to perform a regres

Re: [R] function runif in for loop

2011-08-10 Thread Johannes Radinger
Jean, thank you for your answer. especially the line X <- numeric(length(lT)) helped me a lot. Anyway, in my case I'd like to get a "dynamic" variable or better a function for X. I mean if i try to call X I'd like that this drawing of random number is performed. In the case now if I call X sever

Re: [R] instal tar.gz package on windows

2011-08-10 Thread Lippel, Anna
Hi Duncan, I have tried to install a tar.gz package following your instructions (https://stat.ethz.ch/pipermail/r-help/2008-August/169599.html) but without success. Here are the steps I followed: I installed the last version of Rtools and ran Rcmd INSTALL rJava_0.8-8.tar.gz and got the error m

Re: [R] How to quickly convert a data.frame into a structure of lists

2011-08-10 Thread Frederic F
Hello Duncan, Here is a small example to illustrate what I am trying to do. # Example data.frame df=data.frame(A=c("a","a","b","b"), B=c("X","X","Y","Z"), C=c(1,2,3,4)) # A B C # 1 a X 1 # 2 a X 2 # 3 b Y 3 # 4 b Z 4 ### First way of getting the list structure (ls1) using imbricated lapply

[R] spfeml error message

2011-08-10 Thread Darshana Udayanganie
Hello I am trying to learn the spatial panel data analysis (newbie). I have the R version 2.13.1 and I did download the spml package required for the spatial panel data analysis. However, when I tried the analysis, I get the following error message. “could not find function "spfeml"”. Can somebo

[R] RExcel

2011-08-10 Thread Dr. Alireza Zolfaghari
Hi list, I used to work with RExcel in excel 2003. Now in 2007, I tried the same RExcel, but it did not work. I got R version 12. I downloaded/installed the latest version of RExcel 3.2.0 from http://sunsite.univie.ac.at/rcom/. It has added the RExcel add-ins, but when I click on starting R in add-

Re: [R] round() a data frame containing 'character' variables?

2011-08-10 Thread Jean V Adams
As it says in ?format the digits argument specifies "... how many significant digits are to be used ... enough decimal places will be used so that the smallest (in magnitude) number has this many significant digits ..." In your example, the last value in column "a" is 0.06348058 which is writ

Re: [R] join columns

2011-08-10 Thread Henrique Dallazuanna
Try this: merge(q1, q2, all = TRUE) On Wed, Aug 10, 2011 at 12:04 PM, Anthony Ching Ho Ng wrote: > Dear R-help, > > I wonder if you could give me some suggestions in how to do a union > join of two data frames as follow: > -> union join the common column, and insert a 0 if one is missing. > > I

Re: [R] studentized and standarized residuals

2011-08-10 Thread Dénes TÓTH
Dear Jen, Actually you can check out what R does by looking at the source. # first type the name of the function > rstandard function (model, ...) UseMethod("rstandard") # ?methods will list you the corresponding functions > methods("rstandard") [1] rstandard.glm rstandard.lm # choose rstanda

[R] [R-pkgs] New Matrix and lme4: Must reinstall lme4 if got new Matrix

2011-08-10 Thread Martin Maechler
We have released to CRAN a new version of the (recommended) package Matrix, and of package lme4 yesterday. Anyone who gets the new version of Matrix *MUST* re-install lme4 -- if (s)he is using lme4 at all. Technical details about that further below. The fact that yesterday's version number of Ma

Re: [R] round() a data frame containing 'character' variables?

2011-08-10 Thread Liviu Andronic
Hello On Wed, Aug 10, 2011 at 2:31 PM, Jean V Adams wrote: > The function format() might serve your needs. > This looks very promising, but yields some strange results. See below: > x <- data.frame(a=rnorm(10), b=rnorm(10), c=rnorm(10), d=letters[1:10]) > x a b

Re: [R] Using ANCOVA in R

2011-08-10 Thread Richard M. Heiberger
January, It looks like you will need an interaction effect, perhaps g <- lm( response ~ subject + group*time) Please see the ancova function in the HH package. install.packages("HH") ## if necessary library(HH) ?ancova Rich On Wed, Aug 10, 2011 at 5:15 AM, January Weiner wrote: > Hello, >

Re: [R] join columns

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 11:04 AM, Anthony Ching Ho Ng wrote: Dear R-help, I wonder if you could give me some suggestions in how to do a union join of two data frames as follow: -> union join the common column, and insert a 0 if one is missing. I made a function to perform the following, and I kno

[R] join columns

2011-08-10 Thread Anthony Ching Ho Ng
Dear R-help, I wonder if you could give me some suggestions in how to do a union join of two data frames as follow: -> union join the common column, and insert a 0 if one is missing. I made a function to perform the following, and I know it may not that quite welly written, but it works. Any sug

Re: [R] studentized and standarized residuals

2011-08-10 Thread Jen
Thanks Patrick - at least I know I wasn't being too silly :-) Jen -- View this message in context: http://r.789695.n4.nabble.com/studentized-and-standarized-residuals-tp3732997p3733173.html Sent from the R help mailing list archive at Nabble.com. __ R-

Re: [R] function runif in for loop

2011-08-10 Thread Jean V Adams
Following the suggestion by Duncan Murdoch, this should work for you. X <- runif(length(lT), lT, uT) Jean From: "Johannes Radinger" To: Jean V Adams Cc: r-help@r-project.org Date: 08/10/2011 08:40 AM Subject: Re: [R] function runif in for loop Jean, thank you for your answer. especially

Re: [R] studentized and standarized residuals

2011-08-10 Thread Patrick Breheny
On 08/10/2011 10:03 AM, Jen wrote: Hi, I must be doing something silly here, because I can't get the studentised and standardised residuals from r output of a linear model to agree with what I think they should be from equation form. x = seq(1,10) y = x + rnorm(10) mod = lm(y~x) rstandard(mod) r

[R] Reading XML files masquerading as XL files

2011-08-10 Thread Dennis Fisher
R version 2.13.1 OS X (or Windows) Colleagues, I received a number of files with a .xls extension. These files open in XL and, by all appearances, are XL files. However, it appears to me that the files are actually XML: > readLines(dir()[16])[1:10] [1] ""

Re: [R] Floats in Microsoft Basic format

2011-08-10 Thread Duncan Murdoch
On 10/08/2011 10:16 AM, Barry Rowlingson wrote: On Wed, Aug 10, 2011 at 2:34 PM, Duncan Murdoch wrote: > On 10/08/2011 5:58 AM, taraxacum wrote: >> >> Hi all, >> I need to convert a floating point value from Microsoft Basic format to >> IEEE >> format. >> There's a simple way to achieve t

[R] useR! 2012 Nashville TN: Your Input Needed

2011-08-10 Thread Frank Harrell
So far we have received over 70 responses to our survey. If you have NOT responded already and are likely to attend useR! 2012, please take the extremely short survey today. The link is below. More information about Nashville may be seen at http://biostat.mc.vanderbilt.edu/UseR-2012 In a day or

Re: [R] Floats in Microsoft Basic format

2011-08-10 Thread Barry Rowlingson
On Wed, Aug 10, 2011 at 2:34 PM, Duncan Murdoch wrote: > On 10/08/2011 5:58 AM, taraxacum wrote: >> >> Hi all, >> I need to convert a floating point value from Microsoft Basic format to >> IEEE >> format. >> There's a simple way to achieve this in R or I have to write my own >> function? >> (e.g.

[R] studentized and standarized residuals

2011-08-10 Thread Jen
Hi, I must be doing something silly here, because I can't get the studentised and standardised residuals from r output of a linear model to agree with what I think they should be from equation form. Thanks in advance, Jennifer x = seq(1,10) y = x + rnorm(10) mod = lm(y~x) rstandard(mod) residuals

Re: [R] rbind/cbind

2011-08-10 Thread ONKELINX, Thierry
Can't you use sapply? sapply(seq_len(10), function(i){SomeExpression(i)}) Best regards, Thierry > -Oorspronkelijk bericht- > Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > Namens David Winsemius > Verzonden: woensdag 10 augustus 2011 15:50 > Aan: Anthony Ching

Re: [R] rbind/cbind

2011-08-10 Thread David Winsemius
On Aug 10, 2011, at 9:08 AM, Anthony Ching Ho Ng wrote: Dear list, I wonder if there a better way to have rbind/cbind/append to create the first element (if it is empty) instead of doing the following in a loop? for (i in 1:10) { if (i == 1) { aRow = SomeExpression(i) } else { aRow =

Re: [R] function runif in for loop

2011-08-10 Thread Duncan Murdoch
On 10/08/2011 7:28 AM, Johannes Radinger wrote: Hello, I'd like to perform a regression using MCMCregress (MCMCpack). One variable therefore should be a function rather than a variable: I want to use X as an input and X should be defined as a random number between to values. Therefore I want t

Re: [R] Floats in Microsoft Basic format

2011-08-10 Thread Duncan Murdoch
On 10/08/2011 5:58 AM, taraxacum wrote: Hi all, I need to convert a floating point value from Microsoft Basic format to IEEE format. There's a simple way to achieve this in R or I have to write my own function? (e.g. convert the C code below) You'll need to write your own function. It can be v

Re: [R] How to quickly convert a data.frame into a structure of lists

2011-08-10 Thread Dennis Murphy
To borrow shamelessly from one of the prominent helpers on this list: "What is the problem you're trying to solve?"(attribution: Jim Holtman) I have the sense you want to do something over many subsets of your data frame. If so, breaking things up into lists of lists of lists is not necessari

Re: [R] column names issue with read.csv

2011-08-10 Thread Jean V Adams
Anthony, See ?make.names for a description of valid names. Here's an excerpt: "A syntactically valid name consists of letters, numbers and the dot or underline characters and starts with a letter or the dot not followed by a number. ... The character "X" is prepended if necessary." There is a

Re: [R] function runif in for loop

2011-08-10 Thread Jean V Adams
Johannes, You have the loop set up right, you just need to add indexing to refer to the looping variable, i. lT <- sample(1:10) uT <- sample(21:30) X <- numeric(length(lT)) for (i in 1:length(lT)) X[i] <- runif(1, lT[i], uT[i]) X Note that I changed the name of the result from T to X, because

[R] column names issue with read.csv

2011-08-10 Thread Anthony Ching Ho Ng
Dear List, I wonder why when using read.csv(), if the column name contains a numeric i.e. a stock symbols-"0001.HK", it will automatically insert an "X" character to the column names - "X0001.HK". Now I have to manually do a loop and use substring() to remove the "X" character. Any advice? Thanks

Re: [R] Loops for repetitive task

2011-08-10 Thread Dennis Murphy
Hi: Try this: ## Function that takes a data frame as input and outputs a data frame: chrSumm <- function(d) { # d is a data frame colnames(d) <- c("chr","start","end","base1","base2", "totalreads","methylation","strand") TR <- nrow(d) RG1 <- sum(d['totalreads']

Re: [R] Plotting Ellipses and Points of Matching Colors in an Ordination

2011-08-10 Thread Jean V Adams
Gabe, Since you didn't provide a small example of your data, I can't test out your code. However, I used an example from the ?ordiellipse help page to draw different colored ellipses (using the show.groups= argument) with labels (using the label= argument). Hope this helps. library(vegan) d

  1   2   >