Re: [R] Reading a file created with Fortran

2008-02-26 Thread Dieter Menne
Ben Bolker ufl.edu> writes: > Perhaps read.fwf is what you want? (fwf stands for > "fixed width format"). You would have to work out the > field widths, but it would seem to be pretty straightforward). > [A little bit of extra verbiage will make gmane happier ...] > > Ben Bolker Tru

Re: [R] Loading user defined functions autometically each time I start R

2008-02-26 Thread Arun Kumar Saha
I am using R 2.6.2. under windows On Wed, Feb 27, 2008 at 12:43 PM, <[EMAIL PROTECTED]> wrote: > >From: Arun Kumar Saha <[EMAIL PROTECTED]> > >Date: 2008/02/27 Wed AM 01:03:26 CST > >To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > >Subject: [R] Loading user defined functions autometically each time

[R] how to specify ggplot2 facet plot order

2008-02-26 Thread Chris Friedl
Hi, new to R and ggplot2. I've been trying to get a facet plot in which the order of the facets is as I require, rather than ordered numerically, alphabetically, by Roman numerals, mean (answers to these were posted here after much searching). Here's some test code to demonstrate what I get. seri

Re: [R] "Raw" histogram plots

2008-02-26 Thread Prof Brian Ripley
On Tue, 26 Feb 2008, Andre Nathan wrote: > I know about stem, but the data set has 1 million points, so it's not > very useful here. I want to avoid binning just to have an idea about the > shape of the distribution, before deciding how I'll bin it. Ideas: 1) use a much smaller sample of the dat

[R] Loading user defined functions autometically each time I start R

2008-02-26 Thread Arun Kumar Saha
Hi all, I wrote some user defined function for my own. Now I want to get a mechanism so that every time I start R, those function will automatically be loaded in R without manually copying pasting. Can gurus here pls tell me how to do that? Or I have to build my own packages bundled with those fun

Re: [R] Add a rectangle behind a plot

2008-02-26 Thread Prof Brian Ripley
On Tue, 26 Feb 2008, Judith Flores wrote: > Hi there, > > I found one reference to add a reactangle behind a > plot using plot(...,add=T), I tried this but didn't > obtain the desired result. > > If a I have the following code: > > plot(x,y) > rect(xleft, ybottom, xright,ytop,col='green) > > T

Re: [R] numeric format

2008-02-26 Thread Don MacQueen
While we're at it, and since you're new... Your example will be much easier for r-help folks to read if you do it like this: j <- 0.4 for(i in 1:20) { j=j+0.1 cp[i] <- pnorm(-j*3)*10^6 ratio[i] <- j } table <- data.frame(ratio,cp) table But the loop is unnecessary. Try j <- seq(0

[R] ggplot2 boxplot confusion

2008-02-26 Thread Chris Friedl
Ultimately my aim is to get a plot of density faceted by 2 factors with a horizontal boxplot overlaid on each density plot in the grid to indicate summary stats. So I've been experimenting with creating boxplots and density plots. Here's some representative data. series = c('C2','C4','C8','C10','

[R] multdrc error

2008-02-26 Thread Xin Gong
Dear Sir/Madam: I am newbie of R. I a currently using multdrc object to generate fitting curve and IC50. My 384 well format raw data contains multi dose response curves. My script goes through sets of data then produce curve and ic50. Here is my sudo code: For (plateid in platelist) { Input d

Re: [R] "Raw" histogram plots

2008-02-26 Thread Marc Schwartz
If the goal is to get a sense of the 'shape' of the overall distribution of 'x', then why not use: plot(density(x)) ? HTH, Marc Schwartz Peter Alspach wrote: > Andre > > If I understand you correctly, you could try a barplot() on the result > of table(). > > HTH .. > > Peter Alspach >

[R] Backwards Lasso

2008-02-26 Thread Alethea Rea
Has anyone computed a Backwards lasso with positive coefficients? I would like the R commands or guidance on fitting such a model. The backwards lasso and positively constrained lasso are both described in Least Angle Regression, Efron etal 2002. __ R

Re: [R] Adding LaTeX cross-references into Sweave plots

2008-02-26 Thread Duncan Murdoch
Peter Dunn wrote: > Hi all > > I'm using Sweave and LaTeX, and love how they interact. > > But here's a different interaction I'm not sure how to achieve; I > hope someone can help. I use a simple example, of course, to > demonstrate. > > Suppose in my LaTeX document I have this: > > Here

Re: [R] Kalman Filter

2008-02-26 Thread Spencer Graves
Have you looked at the 'dlm' package? It has a vignette to help you learn to use it. Also, I've heard that a book about that package is scheduled to appear in the next few months. I have looked at the Kalman functions in the 'stats' package but have not found documentation that s

Re: [R] Add a rectangle behind a plot

2008-02-26 Thread Gabor Grothendieck
Just replot the points over it again: points(x, y) Also there is an example using lattice graphics in the Example section of: library(zoo) ?xyplot.zoo On Tue, Feb 26, 2008 at 7:16 PM, Judith Flores <[EMAIL PROTECTED]> wrote: > Hi there, > > I found one reference to add a reactangle behind a >

Re: [R] How to include the documentation of a function in a Sweave document?

2008-02-26 Thread Duncan Murdoch
Thibaut Jombart wrote: > Duncan Murdoch wrote: > >>> Maybe a clue: we can use >>> cat(readLines(as.character(?plot)),sep="\n") >>> >>> to display the help (here, of plot) directly to the screen. So we could >>> use something like: >>> >>> <>= >>> ?plot >>> @ >>> >>> >>> <>=

[R] Adding LaTeX cross-references into Sweave plots

2008-02-26 Thread Peter Dunn
Hi all I'm using Sweave and LaTeX, and love how they interact. But here's a different interaction I'm not sure how to achieve; I hope someone can help. I use a simple example, of course, to demonstrate. Suppose in my LaTeX document I have this: Here is a linear equation: \beg

Re: [R] "Raw" histogram plots

2008-02-26 Thread Peter Alspach
Andre If I understand you correctly, you could try a barplot() on the result of table(). HTH .. Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Andre Nathan > Sent: Wednesday, 27 February 2008 1:34 p.m. > To: roger koenker > C

[R] Hmisc xYplot won't do conditioning on factors?

2008-02-26 Thread Ivan Adzhubey
Hi, I am trying to replace (lattice) standard xyplot with xYplot variant from Hmisc package to be able to add error bars to my plots. However, this does not work, e.g: library(lattice) d <- data.frame( SKU=gl(3, 1, 21, labels=c("a", "b", "c")), Weekday=gl(7, 3, 21), QC

[R] missing packages from install

2008-02-26 Thread array chip
Hi, When I install new packages from CRAN, I frequently find that some packages were missing from the download queue. For example, on one of my computer with R2.6.2, I can not find package glmpath from the download queue. On my other computer with R2.5.1, I could still find that particular package

Re: [R] "Raw" histogram plots

2008-02-26 Thread Andre Nathan
I know about stem, but the data set has 1 million points, so it's not very useful here. I want to avoid binning just to have an idea about the shape of the distribution, before deciding how I'll bin it. Andre On Tue, 2008-02-26 at 16:20 -0600, roger koenker wrote: > take a look at > > ?ste

Re: [R] Highlighting different series with colors

2008-02-26 Thread Michael A. Miller
> "Valentin" == Valentin Bellassen <[EMAIL PROTECTED]> writes: > Hello, I have a data frame with 3 vectors $x, $y, and > $type. I would like to plot $x~$y and having different > colors for the corresponding points, one for each level of > $type. Would someone know how to do tha

[R] Add a rectangle behind a plot

2008-02-26 Thread Judith Flores
Hi there, I found one reference to add a reactangle behind a plot using plot(...,add=T), I tried this but didn't obtain the desired result. If a I have the following code: plot(x,y) rect(xleft, ybottom, xright,ytop,col='green) The rectangle appear on top of the plot. Any help will be gre

[R] score test statistic in logistic regression

2008-02-26 Thread bkelcey
Hi, looking for a function or syntax to estimate the score test in logistic regression for the null hypothesis b1=0 in the model logit(p)=b0+ b1*x +b2*z. Data comes from the binomial distribution (n,p). Thanks, ben __ R-help@r-project.org mailing lis

[R] NLS -- multiplicative errors and group comparison

2008-02-26 Thread Derek Ogle
Hello, I am attempting to fit a non-linear model (Von Bertalanffy growth model) to fish length-at-age data with the purpose of determining if any of the three parameters differ between male and female fish. I believe that I can successfully accomplish this goal assuming an additive error struc

[R] Multiple linear regression with for loop

2008-02-26 Thread M�hlbacher
Hi everyone! I have an array containing the following fields for over hundred compounds: cpd, activity, fixterm, energy1, energy2, energy3, ... I want to run a multiple linear regression on all entries of an array. Therefore I tried to do this with a for loop. (Maybe there is a direct way of c

[R] multdrc error---Error in mdrcOpt(opfct, startVec, optMethod, derFlag, constrained, warnVal

2008-02-26 Thread Xin Gong
Hi, I am newbie of R. I a currently using multdrc object to generate fitting curve and IC50. My 384 well format raw data contains multi dose response curves. My script goes through set of data then produce curve and ic50. Here is my sudo code: For (plateid in platelist) { Input data (

Re: [R] numeric format

2008-02-26 Thread cvandy
Thanks, Erik, This is a partial copy of my code. I want to get rid of the left column of integers and I want to control the number of decimal places after the decimal point. > j<-0.4 > for(i in 1:20){ + j=j+0.1;cp[i]<-pnorm(-j*3)*10^6;ratio[i]<-j} > table<-data.frame(ratio,cp) > table rati

Re: [R] GLM

2008-02-26 Thread Bill.Venables
Just a couple of notes. * What you are attempting to fit here is a linear model, or, more precisely 13112 simple linear regressions. Why not just use 'lm'? 'glm' is for fitting generalized linear models and using it for this special case is going to be computationally costly. [NB the concept

Re: [R] Rcmdr importing excel files

2008-02-26 Thread Prof Brian Ripley
On Tue, 26 Feb 2008, John Fox wrote: > Dear John and Stephen, > > As I recall, importing from Excel, Access, or dBase files works properly > only under Windows, and consequently the menu item appears only in Windows > systems. I frankly don't recall why this is the case, since the RODBC > package

Re: [R] Multiple lines with a different color assigned to each line (corrected code)

2008-02-26 Thread hadley wickham
It's hard to provide a useful answer without know what your data looks like, but maybe something like: library(ggplot2) qplot(timep, mn, data=summ, geom="line", colour = tx) Hadley On Tue, Feb 26, 2008 at 4:24 PM, Judith Flores <[EMAIL PROTECTED]> wrote: > Sorry, I just realized I didn't type in

Re: [R] "Raw" histogram plots

2008-02-26 Thread hadley wickham
On Tue, Feb 26, 2008 at 4:10 PM, Andre Nathan <[EMAIL PROTECTED]> wrote: > Hello > > I need to plot a histogram, but insted of using bars, I'd like to plot > the data points. I've been doing it like this so far: > > h <- hist(x, plot = F) > plot(y = x$counts / sum(x$counts), >x = x$br

[R] lasso with Cox regression

2008-02-26 Thread array chip
Rob Tibshirani propose to use lasso with Cox regression for variable selection in his 1997 paper "The lasso method for variable selection in the Cox model" published in Statistics In Medicine 16:385. I understand the lars() function in lars package implemented lasso, but it does not do lasso with C

Re: [R] Rcmdr importing excel files

2008-02-26 Thread John Kane
Thanks very much. --- John Fox <[EMAIL PROTECTED]> wrote: > Dear John and Stephen, > > As I recall, importing from Excel, Access, or dBase > files works properly > only under Windows, and consequently the menu item > appears only in Windows > systems. I frankly don't recall why this is the > cas

Re: [R] Rcmdr importing excel files

2008-02-26 Thread John Fox
Dear John and Stephen, As I recall, importing from Excel, Access, or dBase files works properly only under Windows, and consequently the menu item appears only in Windows systems. I frankly don't recall why this is the case, since the RODBC package is used. The code for reading these kinds of file

[R] RSPerl on OS X Server 10.4.11

2008-02-26 Thread Gregory Downs
Hello, I tried the R-Sig-Mac list with this query, but had no takers. I hope that the following isn't too far off the mark for this list. Many thanks in advance if someone can help me out! Quick summary: I can't get RSPerl working on a PPC G5 with the pre-compiled binary for Mac OS X, but

Re: [R] Rcmdr importing excel files

2008-02-26 Thread John Kane
I'm on Windows XP R 2.6.2 The command Data > Import > From Excel, Access etc Supply data.frame name Select xls file and then select the sheet seem to work for me What is not showing? --- stephen sefick <[EMAIL PROTECTED]> wrote: > I am using R 2.6.2 on Mac OS X 10.4.9- I would like > to impo

[R] Multiple lines with a different color assigned to each line (corrected code)

2008-02-26 Thread Judith Flores
Sorry, I just realized I didn't type in the correct names of the variables I am working with, this is how it should be: plot(1,1,type="n") for (i in summ$tx) { points(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) lines(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) } Thank you, Judith

Re: [R] numeric format

2008-02-26 Thread Rolf Turner
On 27/02/2008, at 11:01 AM, John Kane wrote: > Can you give a working example of what is happening > and explain what is x? > > With a simple x vector of x <- rnorm(20, 5, 2) > I don't get anything like what you seem to be getting. > > My code > ===

Re: [R] "Raw" histogram plots

2008-02-26 Thread roger koenker
take a look at ?stem There is still a place for handtools in the age of integrated circuits. Of course, avoiding binning isn't really desirable. url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558

[R] "Raw" histogram plots

2008-02-26 Thread Andre Nathan
Hello I need to plot a histogram, but insted of using bars, I'd like to plot the data points. I've been doing it like this so far: h <- hist(x, plot = F) plot(y = x$counts / sum(x$counts), x = x$breaks[2:length(x$breaks)], type = "p", log = "xy") Sometimes I want to have a look

Re: [R] numeric format

2008-02-26 Thread John Kane
Can you give a working example of what is happening and explain what is x? With a simple x vector of x <- rnorm(20, 5, 2) I don't get anything like what you seem to be getting. My code === x <- rnorm(20, 5, 2) table<-data.frame(x, scientific=F, digi

Re: [R] Plot Principal component analysis

2008-02-26 Thread Christos Hatzis
Sorry, it should have been: col = c("red", "blue")[c(rep(1, 100), rep(2, 15))] -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Christos Hatzis > Sent: Tuesday, February 26, 2008 4:46 PM > To: 'SNN'; r-help@r-project.org > Subject: Re: [

Re: [R] Multiple lines with a different color assigned to each line

2008-02-26 Thread John Kane
I am not sure if I completely understand but would something like this work? (not tested) points( col=i) lines ( col=i=1) --- Judith Flores <[EMAIL PROTECTED]> wrote: > Dear R-experts, > >I want to assign different colors to groups of > points, lines and segments in a plot. > > I

Re: [R] numeric format

2008-02-26 Thread jim holtman
Those are parameter to 'print'; what you want is something like: > x <- data.frame(a=runif(10)) > print(x) a 1 0.713705394 2 0.715496609 3 0.629578524 4 0.184360667 5 0.456639418 6 0.008667156 7 0.260985437 8 0.270915631 9 0.689128652 10 0.302484280 > print(x,scientific=F, d

Re: [R] Plot Principal component analysis

2008-02-26 Thread Christos Hatzis
If your samples are in the specified order (i.e. first 100 from group A and remaining from group B) you can try the following in your plot call: plot(..., col=c("red", "blue")[c(rep(100, 1), rep(15, 2))]) -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECT

Re: [R] numeric format

2008-02-26 Thread Erik Iverson
Without knowing what your 'x' is, it's hard to see what is happening that you don't like. Your data.frame function creates a data.frame containing columns scientific and digits, equal to FALSE and 4 for all rows, respectively. Is that what you want? cvandy wrote: > Hi! > I'm an R newbie and

Re: [R] Set without argument

2008-02-26 Thread Christophe Genolini
Hi Martin What do you think of the following code ? A <- 1 imputeMyObj <- function(x){ xImp <- 3 #Calcul for Imputation of x nam<-deparse(substitute(x)) assign(nam,xImp,envir=parent.frame()) } imputeMyObj(A) A I guess it is not usual, but do you think it is 'bad' programming or will have

Re: [R] combining 40,000 with 40,000 data frame (different tact)

2008-02-26 Thread jim holtman
?rbind On 2/26/08, stephen sefick <[EMAIL PROTECTED]> wrote: > I have not been able to find anything to do what I want, so I am going > to tact to the left. I have twp continuous time series for two years > with the same fourteen variables. I would like to simply append the > second year to the

Re: [R] combining 40,000 with 40,000 data frame (different tact)

2008-02-26 Thread Paul Hiemstra
stephen sefick schreef: > I have not been able to find anything to do what I want, so I am going > to tact to the left. I have twp continuous time series for two years > with the same fourteen variables. I would like to simply append the > second year to the first. They both have the same column

[R] lrm error message

2008-02-26 Thread Angelo Passalacqua
I'm trying to learn how to use the lrm() function by simulating data using an old dataset but it's giving me an error I don't understand: (nst$regular already exists) nst$regular<-as.ordered(nst$regular) nst$age<-rnorm(n=942,mean=43.20488,sd=17.03) nst$age<-round(age,digits=0) regform<-regular~

[R] numeric format

2008-02-26 Thread cvandy
Hi! I'm an R newbie and this should be a trivial problem, but I can't make it work and cannot find what I'm doing wrong in the literature. I entered the the command: table<-data.frame(x, scientific=F, digits=4) table This prints a column of x with 16 useless decimal places after the decimal point.

[R] Plot Principal component analysis

2008-02-26 Thread SNN
Hi, I have matrix of 300,000*115 (snps*individual). I ran the PCA on the covariance matrix which has a dimention oof 115*115. I have the first 100 individuals from group A and the rest of 15 individuals from group B. I need to plot the data in two and 3 dimentions with respect to PC1 and PC2 and

[R] Multiple lines with a different color assigned to each line

2008-02-26 Thread Judith Flores
Dear R-experts, I want to assign different colors to groups of points, lines and segments in a plot. I have a vector(dat$tx) that is going to have a different number of levels every time the user wants to plot a set of data. The number of lines is going to be equal to the number of levels of

Re: [R] Summing up diagonals w/o for-loop

2008-02-26 Thread Marc Schwartz
Camarda, Carlo Giovanni wrote: > Dear R-users, > > is there any way to sum up the elements of the "diagonals" of a matrix > without using a for-loop? While there is a simple way over rows and > columns, I don't see a straightforward multiplication for the diagonals, > am I too demanding? Or, more l

Re: [R] Obtaining values from adfstat objects

2008-02-26 Thread Matt33
Thanks for the tip, Erik. I did check, but didn't see any $... elements to choose from. For comparison, I checked another object class (lm) with the str function, and it clearly showed $coefficients, $residuals, etc.. So it would seem that the usual approach doesn't work with adfstat objects... -

Re: [R] Obtaining values from adfstat objects

2008-02-26 Thread Erik Iverson
Try str(yourobject) to see the structure of the object. If there were a value called, say, p.value, you could then do: myvar <- yourobject$p.value This is just general advice, I don't know the specifics of the package you mention, but try this first. Best, Erik Iverson Matt33 wrote: > Hi, >

[R] Obtaining values from adfstat objects

2008-02-26 Thread Matt33
Hi, I'm using the ADF.test function in the uroot package to obtain an adfstat-class object. I'm wondering how I can extract the values (test statistic, p value, etc.) from this class, since it doesn't seem to have usual values. I get the following summary, but I'm not sure how to do anything with

Re: [R] How to include the documentation of a function in a Sweave document?

2008-02-26 Thread Jean lobry
Dear all, thanks for your suggestions. I like the idea of including directly the LaTeX file corresponding to the targeted topic, however, my understanding from the reading of ?help is that these LaTeX files are not always available, depending on the build of R. I found a solution that works well

Re: [R] Summing up diagonals w/o for-loop

2008-02-26 Thread Greg Snow
Does this do what you want? > d <- col(mat) - row(mat) > tapply( mat, d, sum ) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECT

[R] Cryptic error message using RuleFit

2008-02-26 Thread Christopher Schwalm
Hello LIST, In using Rulefit I;ve bee nabel to fit a model using rulefit without incident. However, when trying to use intnull and interact things go astray. > rf=rulefit(x,"N", cat.vars="H", > not.used=c("G","T"),huber=0.9,path.speed=1); [snip] RuleFit model 2/26/2008 2:17p ave(abs(error))

[R] Summing up diagonals w/o for-loop

2008-02-26 Thread Camarda, Carlo Giovanni
Dear R-users, is there any way to sum up the elements of the "diagonals" of a matrix without using a for-loop? While there is a simple way over rows and columns, I don't see a straightforward multiplication for the diagonals, am I too demanding? Or, more likely, I'm lack some algebra trick? Is the

Re: [R] Subsetting within xyplot()

2008-02-26 Thread Erik Iverson
See the description of the subset argument in ?xyplot subset: logical or integer indexing vector (can be specified in terms of variables in 'data'). Only these rows of 'data' will be used for the plot. If 'subscripts' is 'TRUE', the subscripts will provide ind

[R] combining 40,000 with 40,000 data frame (different tact)

2008-02-26 Thread stephen sefick
I have not been able to find anything to do what I want, so I am going to tact to the left. I have twp continuous time series for two years with the same fourteen variables. I would like to simply append the second year to the first. They both have the same column headings etc. Just like tappin

Re: [R] Subsetting within xyplot()

2008-02-26 Thread Henrique Dallazuanna
Try this: xyplot(y ~ x , data = junk.frm, type = c("g", "p","smooth"), pch=20, subset=z=="D" & y < 2) On 26/02/2008, David Afshartous <[EMAIL PROTECTED]> wrote: > > All, > > I'm having problems w/ a simple attempt to subset an xyplot. > > The first plot below is a plot of y versus x for certa

[R] Subsetting within xyplot()

2008-02-26 Thread David Afshartous
All, I'm having problems w/ a simple attempt to subset an xyplot. The first plot below is a plot of y versus x for certain values of a third categorical variable z. Now I'd like to further restrict this to certain values of variable y. Neither of the two attempts below work. Any suggestions m

Re: [R] Kenward-Roger correction in lme

2008-02-26 Thread Douglas Bates
On Mon, Feb 25, 2008 at 1:46 PM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > Ben Bolker wrote: > > stian mail.rockefeller.edu mail.rockefeller.edu> writes: > > > >> Hi,I am wondering how to conduct Kenward-Roger correction in > >> the linear mixed model using R. Any idea? > >> > >> Thanks a

Re: [R] Reading a file created with Fortran

2008-02-26 Thread Ben Bolker
Dennis Fisher plessthan.com> writes: > > Colleagues, > > I am trying to read a file written by Fortran. Several lines of the > file are pasted below: Perhaps read.fwf is what you want? (fwf stands for "fixed width format"). You would have to work out the field widths, but it would seem

[R] Reading a file created with Fortran

2008-02-26 Thread Dennis Fisher
Colleagues, I am trying to read a file written by Fortran. Several lines of the file are pasted below: 101 06e+050280.9777.484208.18147.20.246350.4020.7308717.882600 1 1 101 0.500280.9777.484208.18147.20.246350.4020.7308717.882600 0 0 101 100280.9777.484208.18147.20.246350.4020.730

Re: [R] Custom LaTeX tables

2008-02-26 Thread Gabor Grothendieck
On Tue, Feb 26, 2008 at 10:58 AM, Werner Wernersen <[EMAIL PROTECTED]> wrote: > Hello, > > I am very happy that I have Sweave and R to write my > papers. But I still have to do some tables by hand > since I have not found out how I can customize the > latex tables produced by R further (I mainly us

Re: [R] using eval-parse-paste in a loop

2008-02-26 Thread Tony Plate
Using eval-parse for this looks like overkill. You should just be able to do something straightforward like: for (i in 1:120) assign(paste("book", i, sep=""), read.xls(paste("Book", i, ".xls", sep=""), sheet=1, from=4, colClasses="numeric")) which would put your spreadsheets in variables bo

[R] Kalman Filter

2008-02-26 Thread Vladimír Šamaj
Hi My name is Vladimir Samaj. I am a student of Univerzity of Zilina. I am trying to implement Kalman Filter into my school work. I have some problems with understanding of R version of Kalman Filter in package stats( functions KalmanLike, KalmanRun, KalmanSmooth,KalmanForecast). 1) Can you tell

Re: [R] using eval-parse-paste in a loop

2008-02-26 Thread Bert Gunter
As Thomas Lumley has frequently noted, eval(parse...)) should generally be avoided. You probably want do.call(), as in ## warning: UNTESTED lapply(numbs, function(n)do.call(read.xls,list(file=paste("Book",n,".xls",sep=""),sheet=1, ...))) ## ... contains the other explicitly names arguments N

Re: [R] using eval-parse-paste in a loop

2008-02-26 Thread Erik Iverson
Michael - > > 3. Equally, advice about a better approach would also be v. welcome. > As an alternative approach, you may want to save the sheet names in a list and then use the lapply function to read your data into a list. This would greatly reduce the 'clutter' of objects in your global

Re: [R] using eval-parse-paste in a loop

2008-02-26 Thread Erik Iverson
> ### stripping off eval, looking for clues > > > > parse(paste('read.xls("Book',nam,'.xls",sheet=1,from=4,colClasses="numer > ic")',sep='')) > > Error in file(file, "r") : unable to open connection > > In addition: Warning message: > > In file(file, "r") : > > cannot open fi

Re: [R] R package to perform Horn's parallel analysis

2008-02-26 Thread falissard
And also scree.plot psy package. Bruno Falissard INSERM U669, PSIGIAM "Paris Sud Innovation Group in Adolescent Mental Health" Maison de Solenn 97 Boulevard de Port Royal 75679 Paris cedex 14, France tel : (+33) 6 81 82

[R] using eval-parse-paste in a loop

2008-02-26 Thread Michael Anyadike-Danes
R-helpers I have 120 small Excel sheets to read and I am using library(xlsReadWrite): one example below. I had hoped to read sheets by looping over a list of numbers in their name (eg Book1.xls, Book2.xls, etc). I thought I had seen examples which used eval-parse-paste in this way.

Re: [R] wrapper for save function

2008-02-26 Thread Erik Iverson
Of course the second this showed up on R-help, I got rid of the formal argument 'mydata' and just used ..., which seems to have solved the problem. Erik Erik Iverson wrote: > Hello - > > I would like to create a wrapper to the 'save' function in the base > package, but have a small problem wit

[R] GLM

2008-02-26 Thread Dani Valverde
Hello, I am trying to perform a glm analysis on a 68x13113 matrix (named data.spect). The first column corresponds to the predictor (data.spect[,1]) and the rest to the response variables (data.spect[,2:13113]). When I try this code glmObject <- glm(data.spect[,2:13113]~data.spect[,1]) I get t

[R] wrapper for save function

2008-02-26 Thread Erik Iverson
Hello - I would like to create a wrapper to the 'save' function in the base package, but have a small problem with the name of the object that is getting saved in the file. Below is a simple example illustrating my problem. ## BEGIN SAMPLE R CODE #

Re: [R] projection.matrix() {popbio} for more than one matrix

2008-02-26 Thread Michelle DePrenger-Levin
Hello, I am trying to use the projection.matrix( ) function and am following the example given. I have my data formatted very similar to the test.census example. > str(AsMi05mat) `data.frame': 1854 obs. of 6 variables: $ Tag : num 501 502 503 504 505 506 507 508 509 510 ...

Re: [R] Custom LaTeX tables

2008-02-26 Thread Dieter Menne
Werner Wernersen yahoo.de> writes: > I am very happy that I have Sweave and R to write my > papers. But I still have to do some tables by hand > since I have not found out how I can customize the > latex tables produced by R further (I mainly use > xtable()). Like for instance, I have a table whi

[R] looping with a dynamic variable

2008-02-26 Thread Abi Ghanem josephine
Hi, i am trying to do a small job but it's bugging and i don't know what's happening. let's say i have four matrix, M01_a, M02_a, M01_b, M02_b that looks like this col1 col2 1 20 2 25 3 26 4 30 5 35 6 64 7 75 8 80 9 85

[R] Custom LaTeX tables

2008-02-26 Thread Werner Wernersen
Hello, I am very happy that I have Sweave and R to write my papers. But I still have to do some tables by hand since I have not found out how I can customize the latex tables produced by R further (I mainly use xtable()). Like for instance, I have a table which needs an extra row every few rows as

[R] Getting Stangle to tangle Sexpr expressions

2008-02-26 Thread Michael Hoffman
Is there a way to get Stangle to print out Sexpr expressions as well as code chunks? I am using weaver and when trying to debug Sweave files, it is sometimes difficult to figure out where the error is. The errors are hardest to find when they are in Sexpr expressions because stepping through th

Re: [R] R package to perform Horn's parallel analysis

2008-02-26 Thread William Revelle
see fa.parallel in the psych package At 7:27 AM -0800 2/26/08, Karen Douglas wrote: >I am seeking information on whether anyone has written code to perform >Horn's parallel analysis (a procedure that informs the selection of the >proper number of components in PCA) in R. > > > >Thank you in advan

Re: [R] R package to perform Horn's parallel analysis

2008-02-26 Thread Stéphane Dray
ade4 has the "testdim" function which implements the method proposed in: *S. Dray*. On the number of principal components: A test of dimensionality based on measurements of similarity between matrices. /Computational Statistics and Data Analysis/, 52:2228-2237, 2008. Cheers, Karen Douglas wro

Re: [R] R package to perform Horn's parallel analysis

2008-02-26 Thread Paul Hewson
Dear Karen, You should find the code you want in the package paran: http://cran.r-project.org/web/packages/paran/index.html And you may be interested in looking at the Multivariate Cran Task view which attempts to catalogue these kinds of things: http://cran.r-project.org/web/views/Multivariate.

[R] R package to perform Horn's parallel analysis

2008-02-26 Thread Karen Douglas
I am seeking information on whether anyone has written code to perform Horn's parallel analysis (a procedure that informs the selection of the proper number of components in PCA) in R. Thank you in advance for any help you can provide. Please respond off-list at the email address below. Karen

[R] action executing twice while loading tiles

2008-02-26 Thread arun kumar
*hi I aam facing following problem my action executing twice when i try to load the tileslayout page as actionforward success * [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] combine vector and data frame on field?

2008-02-26 Thread Henrique Dallazuanna
Try this: merge(tsus_same_mean, as.data.frame(tsuPIDCount), by.x="PID", by.y=0) On 26/02/2008, Karin Lagesen <[EMAIL PROTECTED]> wrote: > > I have managed to create a data frame like this: > > > > tsus_same_mean[1:10,] > PIDGrpDist PercAlnPercId > 1 12638 Acid

[R] predict.rpart question

2008-02-26 Thread Damian Krstajic
Dear All, I have a question regarding predict.rpart. I use rpart to build classification and regression trees and I deal with data with relatively large number of input variables (predictors). For example, I build an rpart model like this rpartModel <- rpart(Y ~ X, method="class", minsplit =1, m

[R] Rcmdr importing excel files

2008-02-26 Thread stephen sefick
I am using R 2.6.2 on Mac OS X 10.4.9- I would like to import excel files into R with Rcmdr, but This option does not present itself in the file menu. Any help would be greatly appreciated. Stephen -- Let's not spend our time and resources thinking about things that are so little or so large t

[R] combine vector and data frame on field?

2008-02-26 Thread Karin Lagesen
I have managed to create a data frame like this: > tsus_same_mean[1:10,] PIDGrpDist PercAlnPercId 1 12638 Acidobacteria 0.0 1.000 1.000 2 87 Actinobacteria 0.0 0.970 0.970 3 92 Actinobacteria 0.008902000 1.000 0.991

Re: [R] Combining series of variables using identifier

2008-02-26 Thread Henrique Dallazuanna
Try this: foo <- function(data, ...) { patt <- grep("var[0-9]$", names(data), value=T) res <- paste(sapply(data[, patt], as.character), sapply(data[, paste(patt, "lab", sep="_")], as.character), sep=": ") cbind(a, matrix(res, ncol=length(patt), dimnames=list(NULL, paste(patt, "new", sep="_" }

Re: [R] Combining series of variables using identifier

2008-02-26 Thread K. Elo
Hi, if the columns always follow the same order (indx,var#, var#_lab ...), then You could use the column numbers and do the following: 1) CN<-colnames(df)[#] (#=colnum of 'var#') 2) df$NEW<-(here the expression to create the new variable) 3) colnames(df)[ncol(df)]<-c(paste(CN,"new",sep="_")) Th

[R] predict.rpart question

2008-02-26 Thread Damian Krstajic
Dear All, I have a question regarding predict.rpart. I use rpart to build classification and regression trees and I deal with data with relatively large number of input variables (predictors). For example, I build an rpart model like this rpartModel <- rpart(Y ~ X, method="class", minsplit =

Re: [R] AIC and anova, lme

2008-02-26 Thread Dieter Menne
Patrick Giraudoux univ-fcomte.fr> writes: > > Dear listers, > > Here we have a strange result we can hardly cope with. We want to > compare a null mixed model with a mixed model with one independent > variable. > > > lmmedt1<-lme(mediane~1, random=~1|site, na.action=na.omit, data=bdd2) > >

Re: [R] AIC and anova, lme

2008-02-26 Thread Patrick Giraudoux
ian white a écrit : Patrick, The likelihoods of two models fitted using REML cannot be compared unless the fixed effects are the same in the two models. Many thanks for this reminder. Shame on me: it recalls me that this subject may have been already largely discussed on this list. Now, I

Re: [R] How to include the documentation of a function in a Sweave document?

2008-02-26 Thread Henrique Dallazuanna
You can use '\include' also: \documentclass{article} \begin{document} \include{/usr/local/lib/R/library/graphics/latex/plot} %file.path(system.file(package="graphics"), "latex", "plot") \end{document} I don't know if there is a way of input file.path in include by Sweave. On 25/02/2008, Jean

Re: [R] AIC and anova, lme

2008-02-26 Thread ian white
Patrick, The likelihoods of two models fitted using REML cannot be compared unless the fixed effects are the same in the two models. On Tue, 2008-02-26 at 14:38 +0100, Patrick Giraudoux wrote: > Dear listers, > > Here we have a strange result we can hardly cope with. We want to > compare a n

  1   2   >