Re: [R] Comparison of the amount of computation

2011-04-13 Thread Petr Savicky
On Wed, Apr 13, 2011 at 04:12:39PM -0700, helin_susam wrote: > Hi dear list, > > I want to compare the amount of computation of two functions. For example, > by using this algorithm; > > data <- rnorm(n=100, mean=10, sd=3) > > output1 <- list () > for(i in 1:100) { > data1 <- sample(100, 100, re

Re: [R] Clearing Console- rm(list=ls(all=TRUE)) not working for me

2011-04-13 Thread Rolf Turner
On 14/04/11 15:21, YAddo wrote: Dear all again: I have been trying to clear weeks of codes in my R console, even after quitting and coming back another day!. One of you out there graciously suggested this rm(list=ls(all=TRUE)). I tried this but no dice. Codes tried. Ctrl +L , clears for the

[R] Hash table...

2011-04-13 Thread Worik R
To improve the efficiency of a process I am writing I would like to cache results. So I would like a data structure like a hash table. So if I call Z <- f(Y) I can cache Z associated with Y: CACHE[Y] <- Z I am stumped. I expected to be able to use a list for this but I cannot figure how c

[R] [R-pkgs] tikzDevice 0.6.0

2011-04-13 Thread Charlie Sharpsteen
Cameron and I are pleased to announce version 0.6.0 of the tikzDevice package which should be available shortly at your local CRAN mirror! The tikzDevice makes it possible to export R graphics as LaTeX code that can be included in other documents or compiled into stand alone figures. The full power

[R] Time data

2011-04-13 Thread Gregory Pierce
Hello fellow R-users, I have a data set that includes times in the hh:mm format. I am uncertain how to tell R that it is time data. Currently when I try to calculate a mean with this time subset, I get an error message: > mean(mar2011stats$TT) [1] NA Warning message: In mean.default(mar2011stats$

[R] error for ttest

2011-04-13 Thread 1Rnwb
Hello all, I have arranged my data as per Dennis's suggestion in this post http://www.mail-archive.com/r-help@r-project.org/msg107156.html. the posted code works fine but when I try to apply it to my data, i get "> u2 <- ddply(xxm, .(plateid, cytokine), as.data.frame.function(f)) Error in t.test.f

Re: [R] Clearing Console; of weeks of codes!

2011-04-13 Thread 1Rnwb
click in console window and type rm(list=ls(all=TRUE)), everything will be gone -- View this message in context: http://r.789695.n4.nabble.com/Clearing-Console-of-weeks-of-codes-tp3447506p3448041.html Sent from the R help mailing list archive at Nabble.com. _

[R] Extracting selected rows from a matrix to a submatix

2011-04-13 Thread pankaj borah
I have a matrix M > dim(M) [1] 30380   561 I have another list L contains , that contains some row names of matrix M str (L)  chr [1:21037] Now I want to extract the submatrix subM (21037    ,    561)  from the matrix M by matching the rownames (M) to the 21037 rownames o f L How do I do that

[R] Overlaying images at nodes of phylogenetic tree

2011-04-13 Thread Ryan Doherty
Can you recommend an R library that will help me create a diagram of a phylogenetic tree on which specific images are placed at appropriate nodes of the tree? For example, I have specific image files associated with each member of the phylogenetic tree, and I would like to automate the display

[R] Clearing Console- rm(list=ls(all=TRUE)) not working for me

2011-04-13 Thread YAddo
Dear all again: I have been trying to clear weeks of codes in my R console, even after quitting and coming back another day!. One of you out there graciously suggested this rm(list=ls(all=TRUE)). I tried this but no dice. Codes tried. Ctrl +L , clears for the time... and the the latest i use

[R] extract p-value from mixed model in kinship package

2011-04-13 Thread Ram H. Sharma
Dear R experts I was using kinship package to fit mixed model with kinship matrix. The package looks like lme4, but I could find a way to extract p-value out of it. I need to extract is as I need to analyse large number of variables (> 1). Please help me: require(kinship) Generating random

[R] zooreg and window

2011-04-13 Thread Katrina Bennett
Hello, I have a following time series data head(mend.dat) ID PARAM Year Month Day Value SYM 1 15052500 1 1965 5 15 128 A 2 15052500 1 1965 5 16 135 A 3 15052500 1 1965 5 17 157 A 4 15052500 1 1965 5 18 176 A 5 15052500 1 1965 5 19 198

[R] predict()

2011-04-13 Thread Ivo Shterev
Hi, I am experimenting with the function predict() in two versions of R and the R extension package "survival". library(survival) set.seed(123) testdat=data.frame(otime=rexp(10),event=rep(0:1,each=5),x=rnorm(10)) testfm=as.formula('Surv(otime,event)~x') testfun=function(dat,fm) { predict

[R] if (cond) expr1 expr2 ??

2011-04-13 Thread Mohammad Tanvir Ahamed
hi , this can be done easily if (cond) expr ex:  > for (i in 1: 4)+ {+ if(i==2) print("a")+ if(i==2) print("b")+ } output : [1] "a"[1] "b" but i want this  if (cond) expr1 expr 2 i tried this :  > for (i in 1: 4)+ {+ if(i==2) (print("b") && print("a"))+ } output : [1] "b"Error in print("b") && prin

[R] setting pairwise comparisons of columns

2011-04-13 Thread Louis Plough
Hi, I have a number of genes (columns) for which I want to examine pairwise associations of genotypes (each row is an individual)...For example (see data below), I would like to compare M1 to M2, M2 to M3, and M1 to M3 (i.e. does ac from M1 tend to be found with bc from M2 more often than expected.

[R] Loading a package shared lib works in 2.12 but not 2.11

2011-04-13 Thread Von Der Hirschheydt, Juergen
Hi, I have a problem with an external library on a previous R version. We've created our own package containing a mixture of C++ as well as R code which works fine under R 2.12.1. However, trying to install the very same package ZIP file on R 2.11.1 will issue an error when loading a library:

[R] mixed model random interaction term log likelihood ratio test

2011-04-13 Thread seatales
Hello, I am using the following model model1=lmer(PairFrequency~MatingPair+(1|DrugPair)+(1|DrugPair:MatingPair), data=MateChoice, REML=F) 1. After reading around through the R help, I have learned that the above code is the right way to analyze a mixed model with the MatingPair as the fixed effec

[R] setting pairwise comparisons of columns (genes)

2011-04-13 Thread Louis Plough
Hi, I have a number of genes (columns) for which I want to examine pairwise associations of genotypes (each row is an individual)...For example (see data below), I would like to compare M1 to M2, M2 to M3, and M1 to M3 (i.e. does ac from M1 tend to be found with bc from M2 more often than expected.

[R] Clearing Console; of weeks of codes!

2011-04-13 Thread YAddo
Dear All: I do see I have weeks of codes in my console when I check with my arrow up keys. I have been clearing them with Control L but it seems to clear it clear the screen temporally. I do see the previous codes again when I open R the next day, after quitting the session! Q: How do I clear t

[R] Comparison of the amount of computation

2011-04-13 Thread helin_susam
Hi dear list, I want to compare the amount of computation of two functions. For example, by using this algorithm; data <- rnorm(n=100, mean=10, sd=3) output1 <- list () for(i in 1:100) { data1 <- sample(100, 100, replace = TRUE) statistic1 <- mean(data1) output1 <- c(output1, list(statistic1)) }

Re: [R] File > Save As...

2011-04-13 Thread Gene Leynes
as of right now x = function(a) print(a) attr(x, "srcref") returns NULL in 2.13, am I doing something wrong? (also, should I post this to a new thread, or the development thread?) About me: I like long walks on the beach, and this is my current version of R: > t(as.data.frame(R.Version())

Re: [R] Incremental ReadLines

2011-04-13 Thread Freds
Hi there, I am having a similar problem with reading in a large text file with around 550.000 observations with each 10 to 100 lines of description. I am trying to parse it in R but I have troubles with the size of the file. It seems like it is slowing down dramatically at some point. I would be h

[R] area under roc curve

2011-04-13 Thread agent dunham
Dear all, I want to measure the goodness of prediction of my linear model. That's why I was thinking about the area under roc curve. I'm trying the following, but I don't know how to avoid the error. Any help would be appreciated. library(ROCR) model.lm <- lm(log(outcome)~log(v1)+log(v2)+f

[R] please help

2011-04-13 Thread Arnab Chowdhuri
van=function(a,x,n){ A<<-matrix(c(x[1]^2,x[1],1,x[2]^2,x[2],1,x[3]^2,x[3],1),byrow=T,nrow=3) for(i in 1:3){ o<<-x[i] for(j in sort(1:n+1,decreasing=T)){ B[i][j]<<-(o)^(n+1-j) } } y=vector(length=3) y<<-B%*%a p=vector(length=3) p<<-solve(A,y) return(p) } this is my function and I am getting an

[R] any package for Heckman selection model when the outcome equation also probit ?

2011-04-13 Thread Yong Wang
Hi, all Can anybody hint if there is extant package or function to deal with Heckman selection model where the outcome model is also probit? In stata, it is called heckprob. Thank you yong __ R-help@r-project.org mailing list https://stat.ethz.ch/m

[R] add names to data frame

2011-04-13 Thread Radhouane Aniba
Hi, I have a vector V of values I used to create a distance matrix using dist() function with diag=TRUE and upper=TRUE parameters. I would like to assign names in another vector on top of each column instead of 1 2 3 4 ... How can we do that ? is the distance matrix generated a data frame or a m

Re: [R] Density estimation and plots

2011-04-13 Thread Jim Silverton
I have two columns of data, one is a subset of the other. All the data lie beteen 0 and 1 inclusive. I want to fit both densities on the same graph. I would also like the ability to extract the fitted values of both smoothed density (using the best method of course). For example, if h = c( runif(1

Re: [R] Previously attainable fisher's exact test

2011-04-13 Thread Ted Harding
On 13-Apr-11 17:40:53, Jim Silverton wrote: > I have a matrix say, > > 1 4 > 23 30 > > and I want to find the previously attainable fisher's exact test > p-value. Is there a way to do this in R? > -- > Thanks, > Jim. I do not understand what you mean by "previously attainable". As far as tha

Re: [R] Line plots in base graphics

2011-04-13 Thread baptiste auguie
On 14 April 2011 07:51, Hadley Wickham wrote: > Am I missing something obvious on how to draw multi-line plots in base > graphics? > > In ggplot2, I can do: It appears you've been infected with what I like to call "the Dijkstra syndrome" [*], quoting "The tools we use have a profound (and devio

Re: [R] Line plots in base graphics

2011-04-13 Thread Ben Bolker
Hadley Wickham rice.edu> writes: > On Wed, Apr 13, 2011 at 2:58 PM, Ben Bolker gmail.com> wrote: > > Hadley Wickham rice.edu> writes: > > > >> > >> Am I missing something obvious on how to draw multi-line plots in > >> base graphics? [snip] > >> But in base graphics, the best I can come up w

Re: [R] is this an ANOVA ?

2011-04-13 Thread Bill.Venables
You probably want to do something like this: > fm <- lm(y ~ x, MD) > anova(fm) Analysis of Variance Table Response: y Df Sum Sq Mean Sq F valuePr(>F) x 2250 125.0 50 1.513e-06 Residuals 12 30 2.5 Answers to questions: 1. No. 2. Yes. (whoever you ar

Re: [R] area under roc curve

2011-04-13 Thread Frank Harrell
ROC area does not measure goodness of prediction but does measure pure predictive discrimination. The generalization of the ROC area is the C-index for continuous or censored Y. See for example the rcorr.cens function in the Hmisc package. Frank agent dunham wrote: > > Dear all, > > > I want

Re: [R] File > Save As...

2011-04-13 Thread Gene Leynes
That's very interesting. It's not what I was thinking about or expecting, but I'm glad to know about it (and it will probably be useful at some point). Initially, I was asking for a method to find out the name of the current script. I mean, the current script that you're editing / running. Howe

[R] for loop performance

2011-04-13 Thread Barth B. Riley
Dear list I am running some simulations in R involving reading in several hundred datasets, performing some statistics and outputting those statistics to file. I have noticed that it seems that the time it takes to process of a dataset (or, say, a set of 100 datasets) seems to take longer as th

Re: [R] File > Save As...

2011-04-13 Thread Duncan Murdoch
On 13/04/2011 5:20 PM, Gene Leynes wrote: as of right now x = function(a) print(a) attr(x, "srcref") returns NULL in 2.13, am I doing something wrong? There's a limitation to the debug information: it can't be attached to a function whose body consists of a single simple expression

Re: [R] Decimals in R/SQL

2011-04-13 Thread Seth Falcon
On Wed, Apr 13, 2011 at 1:34 PM, Rachel Licata wrote: > Thanks again Jim - that is really helpful and I apologize that I am > new to R.  How can I convert to numeric in SQL and when I am working > on a table in a database?  The file is huge so that is why I am > using SQL and the database to work

Re: [R] Line plots in base graphics

2011-04-13 Thread Hadley Wickham
On Wed, Apr 13, 2011 at 2:58 PM, Ben Bolker wrote: > Hadley Wickham rice.edu> writes: > >> >> Am I missing something obvious on how to draw multi-line plots in >> base graphics? >> >> In ggplot2, I can do: >> > data(Oxboys, package = "nlme") > library(ggplot2) > > qplot(age, height, data = Oxboys

Re: [R] latex, eps graphics and transparent colors

2011-04-13 Thread Ben Bolker
Thomas Lumley uw.edu> writes: > > On Thu, Apr 14, 2011 at 5:30 AM, > Michael Friendly yorku.ca> wrote: > > I have a diagram to be included in latex, where all my figures are .eps > > graphics (so pdflatex is not an option) > > You could use the pdf() device and then use pdf2ps to convert to

Re: [R] FW: [r] how to enclose two xyplot

2011-04-13 Thread baptiste auguie
Hi, Have you tried ?c.trellis in the latticeExtra package? HTH, baptiste On 13 April 2011 23:36, Francesco Nutini wrote: > >  Dear R-users, > > I have to plot two xyplot, and I wish to enclose this two graphs with just > one headline, the same x scale, the same grid etc. > These parameters sh

Re: [R] problem with all/all.equal

2011-04-13 Thread MacQueen, Don
The help pages for identical() and all.equal() have information that will make it clear why they don't do what you want. In the meantime, I tend to use a construct such as: length(unique(x))==1 But be careful if x is not a vector. No doubt there are other ways. -Don -- Don MacQueen Lawren

Re: [R] Decimals in R/SQL

2011-04-13 Thread Gabor Grothendieck
On Wed, Apr 13, 2011 at 4:34 PM, Rachel Licata wrote: > Thanks again Jim - that is really helpful and I apologize that I am new to R. >  How can I convert to numeric in SQL and when I am working on a table in a > database?  The file is huge so that is why I am using SQL and the database to > wo

Re: [R] Decimals in R/SQL

2011-04-13 Thread Rachel Licata
Thanks again Jim - that is really helpful and I apologize that I am new to R. How can I convert to numeric in SQL and when I am working on a table in a database? The file is huge so that is why I am using SQL and the database to work through it. Thanks! -Original Message- From: jim

Re: [R] latex, eps graphics and transparent colors

2011-04-13 Thread Thomas Lumley
On Thu, Apr 14, 2011 at 5:30 AM, Michael Friendly wrote: > I have a diagram to be included in latex, where all my figures are .eps > graphics (so pdflatex is not an > option) You could use the pdf() device and then use pdf2ps to convert to PostScript. >and I want to achieve something > like the

Re: [R] Line plots in base graphics

2011-04-13 Thread Ben Bolker
Hadley Wickham rice.edu> writes: > > Am I missing something obvious on how to draw multi-line plots in > base graphics? > > In ggplot2, I can do: > data(Oxboys, package = "nlme") library(ggplot2) qplot(age, height, data = Oxboys, geom = "line", group = Subject) > But in base graphics, the

Re: [R] latex, eps graphics and transparent colors

2011-04-13 Thread Ben Bolker
Michael Friendly yorku.ca> writes: > > I have a diagram to be included in latex, where all my figures are .eps > graphics (so pdflatex is not an > option) and I want to achieve something > like the following: three concentric filled circles varying in lightness > or saturation. It is easiest

[R] Line plots in base graphics

2011-04-13 Thread Hadley Wickham
Am I missing something obvious on how to draw multi-line plots in base graphics? In ggplot2, I can do: data(Oxboys, package = "nlme") library(ggplot2) qplot(age, height, data = Oxboys, geom = "line", group = Subject) But in base graphics, the best I can come up with is this: with(Oxboys, plot(

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread mat
Barry, thanks a lot for checking for this!! Find below answers. Le 13. 04. 11 18:26, Barry Rowlingson a écrit : 2011/4/13 Matthieu Stigler: Jim Thanks for your feedback! The problem is that the people "those responsible for layout" are us... We are doing the book in Latex, and till now did not

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread baptiste auguie
Hi, I may be wrong, but I have the impression that tikz (a LaTeX drawing package) can handle spot colors (that's what Google seemed to tell me [*]). If this is the case you could output R graphics using the tikzDevice package, post-process the output (readable, plain text file), and eventually hav

[R] Data with different time lines for one analysis

2011-04-13 Thread Oliver
Hello I have one data set that is in the range from 1950 to 2009 with yearly values (one value per year), and another one from 1959 to 1983 with 364 values, which means 15 values per year. Now I want to use both sets in some analysis, one for example ccf, but also other analyses. What would you

Re: [R] Removing objects and clearing memory

2011-04-13 Thread Jim Silverton
On Wed, Apr 13, 2011 at 11:12 AM, Jim Silverton wrote: > Hey guys thanks very much for al your responses. It was very helpful. > > Jim > > > On Tue, Apr 12, 2011 at 6:59 PM, Peter Ehlers wrote: > >> On 2011-04-12 15:52, seeliger.c...@epamail.epa.gov wrote: >> >>> How do I remove all objects exce

Re: [R] Wilcoxon rank sum in unbalanced design

2011-04-13 Thread peter dalgaard
On Apr 13, 2011, at 17:07 , netrunner wrote: > Hi everyone! > I need to perform a Wilcoxon rank sum test, but I have some ties and the > groups have different size also. When I deal with ties I use the > wilcox.exact function, how can I solve the different size problem using this > function? Wh

Re: [R] How to get the names of all the packages that depend on a give package?

2011-04-13 Thread Ben Bolker
Dennis Murphy gmail.com> writes: > > Hi: > > Here's one way, assuming Matrix (or whichever package you want to > investigate) is installed on your system: > > u <- installed.packages() > u['Matrix', 'Depends'] > [1] "R (>= 2.10.0), stats, methods, utils, lattice" > > HTH, > Dennis > Or, i

Re: [R] Previously attainable fisher's exact test

2011-04-13 Thread Jim Silverton
I have a matrix say, 1 4 23 30 and I want to find the previously attainable fisher's exact test p-value. Is there a way to do this in R? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://sta

Re: [R] Fwd: CRAN problem with plyr-1.4.1

2011-04-13 Thread Uwe Ligges
On 12.04.2011 17:29, Hadley Wickham wrote: Then, can we have the ERROR message, please? Otherwise the only explanation I can guess is that a mirror grabs the contents of a repository exactly in the second the repository is updated and that is unlikely, particularly if more than one mirror is in

[R] latex, eps graphics and transparent colors

2011-04-13 Thread Michael Friendly
I have a diagram to be included in latex, where all my figures are .eps graphics (so pdflatex is not an option) and I want to achieve something like the following: three concentric filled circles varying in lightness or saturation. It is easiest to do this using transparency, but in my test usi

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Jeremy Hetzel
By the way, I had trouble importing PDFs into Scribus 1.3.3. However, Scribus 1.4.0rc3 had no problem opening multi-page PDFs, assuming the appropriate Ghostscript was also installed (I'm on Windows 7 at the moment). So Matthieu might be able to combine all of his figures into a single PDF, c

Re: [R] B %*% t(B) = R , then solve for B

2011-04-13 Thread Doran, Harold
Correct. In the example I gave you yesterday, I used a different matrix, but showed this solution because it also answered the other question you had about doing it on non-square matrices. Of course, Spencer Graves also gave a very useful answer suggesting QR decomposition. I also gave you the

Re: [R] How to get the names of all the packages that depend on a give package?

2011-04-13 Thread Gabor Grothendieck
On Wed, Apr 13, 2011 at 11:57 AM, thmsfuller...@gmail.com wrote: > Dear All, > > I want to check what packages depends on a given package. For example, > glmnet depends on Matrix. I want get the names of all the packages > that depend on Matrix on CRAN. Is there a way to do so? Thanks! > >> librar

Re: [R] How to get the names of all the packages that depend on a give package?

2011-04-13 Thread Dennis Murphy
Hi: Here's one way, assuming Matrix (or whichever package you want to investigate) is installed on your system: u <- installed.packages() u['Matrix', 'Depends'] [1] "R (>= 2.10.0), stats, methods, utils, lattice" HTH, Dennis On Wed, Apr 13, 2011 at 8:57 AM, thmsfuller...@gmail.com < thmsfuller.

Re: [R] Decimals in R/SQL

2011-04-13 Thread jim holtman
The problem is that you data is 'integer' and I assume that the database is keeping everything integer. You can do what you are doing, or convert to 'numeric': > x <- read.table(textConnection(" ST AGEP > PWGTP + 33323130

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Barry Rowlingson
On Wed, Apr 13, 2011 at 5:26 PM, Jeremy Hetzel wrote: > Scribus claims to be able to convert RGB/CMYK colors to spot colors: > http://documentation.scribus.net/index.php/Spot_Colors > > I've never used Scribus, but it's floss. Scribus can import output from R's svg driver (with at least some deg

Re: [R] Decimals in R/SQL

2011-04-13 Thread Rachel Licata
Thanks Jim. It appears the issue may only be in SQLite. SS09 is a large table and here is a subset of the variables I am working with. SS09 ST AGEPPWGTP 33323130 130 33324110

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Jeremy Hetzel
Scribus claims to be able to convert RGB/CMYK colors to spot colors: http://documentation.scribus.net/index.php/Spot_Colors I've never used Scribus, but it's floss. Jeremy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Barry Rowlingson
2011/4/13 Matthieu Stigler : > Jim > > Thanks for your feedback! The problem is that the people "those responsible > for layout" are us... We are doing the book in Latex, and till now did not > need any other software. > > But I am scared we will need use kind of Indesign & co softwares to be able

Re: [R] Decimals in R/SQL

2011-04-13 Thread jim holtman
You at least have to provide a subset of 'ss09' so we can see what the original data looks like. I have not had any problems with decimals in using sqldf. > x <- as.data.frame(matrix(runif(100)*100, 10)) > x$key <- sample(1:3, 10, TRUE) > require(sqldf) > xsum <- sqldf(' + select key, sum(V1

[R] How to get the names of all the packages that depend on a give package?

2011-04-13 Thread thmsfuller...@gmail.com
Dear All, I want to check what packages depends on a given package. For example, glmnet depends on Matrix. I want get the names of all the packages that depend on Matrix on CRAN. Is there a way to do so? Thanks! > library(glmnet) Loading required package: Matrix Loading required package: lattice

Re: [R] glmnet

2011-04-13 Thread Alexander Engelhardt
Am 13.04.2011 16:58, schrieb Janina Hemmersbach: Hello, I´m trying to in install the package 'glmnet' but I get always the error massage "package ‘Matrix’ is not available". I search on you site, but I coundn´t find the package there either. Is their still a package called "Matrix"? Or how can

[R] plotting line graphs for output from crosstabs function

2011-04-13 Thread taby gathoni
Hi R-users, This is a generic question, is there a way to plot a line graph for the output from crosstable function? one of the inputs to the crosstab function is categorical. Taby -- [[alternative HTML version deleted]] __ R-help@r-

Re: [R] glmnet

2011-04-13 Thread Ben Bolker
Janina Hemmersbach scai.fraunhofer.de> writes: > > Hello, > I´m trying to in install the package 'glmnet' > but I get always the error massage "package ‘Matrix’ is > not available". I search on you site, but I coundn´t > find the package there either. Is their still a > package called "Matrix"?

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Matthieu Stigler
Jim Thanks for your feedback! The problem is that the people "those responsible for layout" are us... We are doing the book in Latex, and till now did not need any other software. But I am scared we will need use kind of Indesign & co softwares to be able to use our R plots, since R can't ex

Re: [R] split string into individual valus while reading in R

2011-04-13 Thread Upton, Stephen (Steve) (CIV)
Hi Ram, Try this on your V4: d <- yourdf$V4 unlist(lapply(1:nchar(d),function(x) substr(d,x,x))) HTH steve -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ram H. Sharma Sent: Wednesday, April 13, 2011 7:34 AM To: r-help@r-project.or

[R] glmnet

2011-04-13 Thread Janina Hemmersbach
Hello, I´m trying to in install the package 'glmnet' but I get always the error massage "package ‘Matrix’ is not available". I search on you site, but I coundn´t find the package there either. Is their still a package called "Matrix"? Or how can I use "glmnet"? Thank You in advance. Kind regard

[R] Wilcoxon rank sum in unbalanced design

2011-04-13 Thread netrunner
Hi everyone! I need to perform a Wilcoxon rank sum test, but I have some ties and the groups have different size also. When I deal with ties I use the wilcox.exact function, how can I solve the different size problem using this function? thanks net -- View this message in context: http://r.789

[R] Decimals in R/SQL

2011-04-13 Thread Rachel Licata
Hello, When I am writing in sqldf or RSQLite I lose the decimals in my matrix. The only way I can get decimals is by multiplying by 1.0, etc. I have tried manipulating the options, but it is only effective once I multiply by 1.. I appreciate any suggestions! Thanks! Example: z <- s

Re: [R] Removing objects and clearing memory

2011-04-13 Thread Jim Silverton
Hey guys thanks very much for al your responses. It was very helpful. Jim On Tue, Apr 12, 2011 at 6:59 PM, Peter Ehlers wrote: > On 2011-04-12 15:52, seeliger.c...@epamail.epa.gov wrote: > >> How do I remove all objects except one in R? > > rm(list=ls()) #will remove ALL objects >

Re: [R] Overcoming warning in package zoo

2011-04-13 Thread Gabor Grothendieck
On Wed, Apr 13, 2011 at 10:38 AM, Rita Carreira wrote: > > Dear R users,I have a long program that I am trying to run--I am using > RStudio as my interface with R. The pieces of the program run well > individually but when I try to run everything in sequence it bogs down > because of a warning

[R] Overcoming warning in package zoo

2011-04-13 Thread Rita Carreira
Dear R users,I have a long program that I am trying to run--I am using RStudio as my interface with R. The pieces of the program run well individually but when I try to run everything in sequence it bogs down because of a warning after using rollmax from package zoo. Here is the warning: "In ro

Re: [R] Find characters in a matrix and return a TRUE-FALSE vector

2011-04-13 Thread Jorge Ivan Velez
Hi Nina, You might try sapply(yourdata, function(x) any(x == "C")) See ?sapply for more details. HTH, Jorge On Wed, Apr 13, 2011 at 7:17 AM, Vitrifizierung <> wrote: > I have the following problem: > > My data is a matrix of multiple columns and rows. The column I am > interested > in looks

[R] ordinal predictor in anova

2011-04-13 Thread Vincent Staszewski
Hi, I have a dataset with a continuous response variable and, among other predictors, an ordinal variable. Here is what it could look like treatment <- factor(rep(c("AA", "AC", "AD","AE", "AB"), each = 10)) length <- c(75, 67, 70, 75, 65, 71, 67, 67, 76, 68, 57, 58, 60, 5

[R] Boxplot with two or more Y vectors

2011-04-13 Thread Håvard Wahl Kongsgård
Hi, for a simple boxplot in R, in the formula is it possible to include two or more Y vectors directly. Or is that only possibility by aggregating the data first? -- Håvard Wahl Kongsgård Peace Research Institute Oslo (PRIO) http://havard.security-review.net/ [[alternative HTML version

[R] ddply and nlminb

2011-04-13 Thread Robert Clement
Hello I'm new to R (one week) so please excuse any obvious mistakes in my code or posting. I am attempting to fit a non linear function defining the relationship between dependent variable A and the variables PAR and T grouped by the condition Di. The following steps are taken in the Rcod

Re: [R] split string into individual valus while reading in R

2011-04-13 Thread Ram H. Sharma
It looks like my question is not clear, I have not get any suggestion, yet let me reiterate my problem: My data looks like this to be read from a text file. As I provided earlier the A, B, and H in V4 column has much longer chain. V1 V2 V3V4 1_1ch1 0.0 AHAH 1_2

[R] Find characters in a matrix and return a TRUE-FALSE vector

2011-04-13 Thread Vitrifizierung
I have the following problem: My data is a matrix of multiple columns and rows. The column I am interested in looks like that (I think it is a column in a matrix that contains a vector each?): [[1]] [1] A B C [4] D E [[2]] [1] A D E [[3]] [1] C E F [4] G I now want to look for a special word (

Re: [R] 1 continuous non-normal variable ~ 4 factors + 1 continuous covariate (with interactions)

2011-04-13 Thread Alal
Thanks, I guess I can do that, and it actually seem appropriate for one of my variable. But can you do post-hoc tests on a survival analysis? Use contrasts or something? -- View this message in context: http://r.789695.n4.nabble.com/1-continuous-non-normal-variable-4-factors-1-continuous-covar

Re: [R] split string into individual valus while reading in R

2011-04-13 Thread Ram H. Sharma
Sorry NULL in V8 should be corrected as NA On Wed, Apr 13, 2011 at 7:33 AM, Ram H. Sharma wrote: > It looks like my question is not clear, I have not get any suggestion, yet > let me reiterate my problem: > > My data looks like this to be read from a text file. As I provided earlier > the A, B, a

[R] iterative method in R software

2011-04-13 Thread rvohen
In confirmatory factor analysis,we need to estimate unknown parameters . I read a book about it,which needs iterative method to estimate parameters,but I don't know it.Does someone konw it?Thank u! -- View this message in context: http://r.789695.n4.nabble.com/iterative-method-in-R-software-tp344

Re: [R] Merge matrix

2011-04-13 Thread Pankaj Barah
Hi Kevin, Sorry.it is not Bt ? A and B are two independent Matrices with equal number rows and different number of columns. dim (A) [1] 30380 104 dim(B) [1] 3038063 I want to combine both A and B to matrix C wheredim(C) [1] 30380 167 So I got the answer C<-cbind(A,B) Thanks and reg

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-13 Thread Karl Ove Hufthammer
Marius Hofert wrote: > Haha, I found a hack (using the letter "l"): > > plot(0,0,main=expression(italic(X)[1]^bolditalic("l"))) Why cheat when you can use a *real* prime character: plot(0, 0, main=expression(paste(italic(X)[1],"\u2032"))) -- Karl Ove Hufthammer

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Hadley Wickham
> Even so, this would depend on what your publisher/printer > requires in what you submit. It would be important to obtain > from them a full and exact specification of what they require > for colour printing in files submitted to them for printing. No one else has mentioned this, but the publishe

Re: [R] MLE where loglikelihood function is a function of numerical solutions

2011-04-13 Thread Berend Hasselman
Questions: 1. why are you defining Bo within a loop? 2. Why are you doing library(nleqslv) within the loop? Doing both those statements outside the loop once is more efficient. In your transdens function you are not using the function argument parameters, why? Shouldn't there be a with(paramete

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Ben Bolker
Prof Brian Ripley stats.ox.ac.uk> writes: > > On Wed, 13 Apr 2011, Ben Bolker wrote: > > > Matthieu Stigler gmail.com> writes: > > > >> > >> Hi > >> > >> We are about to publish a book, which contains figures made with R > >> plots. An important detail that we did not take into account is that

Re: [R] strategy for writing out file with lines header initiated with comment sign

2011-04-13 Thread Mao Jianfeng
Dear Jim and Rainer, I learned much from you all. It is my first time to experience the functions, like file(), writeLines(), close(). Thanks a lot. Best, Jian-Feng, 2011/4/13 Rainer M Krug : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 13/04/11 15:15, jim holtman wrote: >> Here is

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Prof Brian Ripley
On Wed, 13 Apr 2011, Ben Bolker wrote: Matthieu Stigler gmail.com> writes: Hi We are about to publish a book, which contains figures made with R plots. An important detail that we did not take into account is that the book will not be printed in 4 colors (cmyk mode), but only 2 (black +"spo

Re: [R] strategy for writing out file with lines header initiated with comment sign

2011-04-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/04/11 15:15, jim holtman wrote: > Here is an outline of how to do it using connections: > > con <- file('/temp/mytemp.txt', 'w') > writeLines(c("#comment", "# lines", "# in the file"), con = con) > # create some data to be output as 'tab' separa

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Ted Harding
On 13-Apr-11 12:30:26, Ben Bolker wrote: > Matthieu Stigler gmail.com> writes: >> >> Hi >> We are about to publish a book, which contains figures made >> with R plots. An important detail that we did not take into >> account is that the book will not be printed in 4 colors >> (cmyk mode), but onl

Re: [R] strategy for writing out file with lines header initiated with comment sign

2011-04-13 Thread jim holtman
Here is an outline of how to do it using connections: con <- file('/temp/mytemp.txt', 'w') writeLines(c("#comment", "# lines", "# in the file"), con = con) # create some data to be output as 'tab' separated myData <- as.data.frame(matrix(letters[1:25], 5)) write.table(myData, file = con, sep = '\t

[R] BackCast and Forecast with stats.arima and forecast.Arima

2011-04-13 Thread Paolo Rossi
Hello everyone, I am experiencng some problems in producing forecasts and backcast from an ARIMA(1,0,0) model. I need to produce an insample backcast and a seasonal normal backcast and forecast. I have a seasonal consumption function. By using actual data I get actual demand. By passing Seasonal N

Re: [R] Is there a better way to parse strings than this?

2011-04-13 Thread Gabor Grothendieck
On Wed, Apr 13, 2011 at 12:07 AM, Chris Howden wrote: > Hi Everyone, > > > I needed to parse some strings recently. > > The code I've wound up using seems rather clunky, and I was wondering if > anyone had any suggestions on a better way? > > Basically I do the following: > > 1) Use substr() to do

Re: [R] Is there a better way to parse strings than this?

2011-04-13 Thread Hadley Wickham
On Wed, Apr 13, 2011 at 5:18 AM, Dennis Murphy wrote: > Hi: > > Here's one approach: > > strings <- c( > "A5.Brands.bought...Dulux", > "A5.Brands.bought...Haymes", > "A5.Brands.bought...Solver", > "A5.Brands.bought...Taubmans.or.Bristol", > "A5.Brands.bought...Wattyl", > "A5.Brands.bought...Other"

Re: [R] R plots pdf() does not allow spotcolors?

2011-04-13 Thread Ben Bolker
Matthieu Stigler gmail.com> writes: > > Hi > > We are about to publish a book, which contains figures made with R > plots. An important detail that we did not take into account is that the > book will not be printed in 4 colors (cmyk mode), but only 2 (black > +"spotcolor"). The spotcolor we

  1   2   >