[R] how to get the result in "short cut" manner?

2011-08-16 Thread Lao Meng
Hi all: My data:data(sleep) If I wanna calculate each group's extra,what I can do is: #method1 attach(sleep) mean(extra[group==1]) mean(extra[group==1]) #method2 result<-matrix(,0,2) g<-split(sleep,sleep$group) for(i in 1:length(g)) { result<-rbind(result,data.frame(unique(g[[i]]$group),mean(g[[

Re: [R] how to get the result in "short cut" manner?

2011-08-16 Thread Lao Meng
Sorry,I miss a word:"If I wanna calculate each group's mean extra" 2011/8/16 Lao Meng > Hi all: > My data:data(sleep) > > If I wanna calculate each group's extra,what I can do is: > #method1 > attach(sleep) > mean(extra[group==1]) > mean(extra[group==1]) > > > #method2 > result<-matrix(,0,2) >

Re: [R] how to get the result in "short cut" manner?

2011-08-16 Thread Eik Vettorazzi
Hi Lao, you tried to reinvent the wheel. Have a look at ?tapply tapply(sleep$extra,sleep$group,mean) Cheers Am 16.08.2011 09:41, schrieb Lao Meng: > Hi all: > My data:data(sleep) > > If I wanna calculate each group's extra,what I can do is: > #method1 > attach(sleep) > mean(extra[group==1]) > m

Re: [R] a question about lm on t-test.

2011-08-16 Thread Eik Vettorazzi
Hi, you may have noticed, that your t-test and lm had not the same p-values for the difference in means, which is calculated for group2 when you use treatment contrasts and that is what R does by default (see ?contr.treatment). This is because R uses Welsh test by default. Pros and cons are beyond

Re: [R] plotting segments only and in color

2011-08-16 Thread Eik Vettorazzi
Hi Johannes, plot(X,Y,type="n") creates an empty plot with correct dimensions, ind<-!(Xb==Xa) points(X[ind],Y[ind]) plots points for zero-length intervals only, and gray() can be used for shading lines, as in segments(Xa,Y,Xb,Y,col=gray(.9*(Xb-Xa)/max(Xb-Xa))) #the longest interval will be gray(.9)

[R] deSolve, extracting variable values from inside ode function

2011-08-16 Thread Jim Maas
I'm just getting to grips with using ode function and have used the examples and vignettes to produce a small model of a one-pool, michaelis-menten, enzyme kinetic reaction. The rate of flux of substrate into pool A is constant (fluxoa) however the rate of flux out of pool A is controlled by th

[R] cbin *-* Problem with different vector lenghts

2011-08-16 Thread Geophagus
Hi @ all, I have the following question: Is there a possibilty to cbind tree dataframes with different numbers of rows? Here is my example: > b2007 5 8 1 1 > b2008 3 6 8 3 1 2 > b2009 1 3 8 1 2 1 > cbind (b2007,b2008,b2009) b2007 b2008 b2009 3 1 3 1 6 1 1 2 8 1

[R] Cubic splines in package "mgcv"

2011-08-16 Thread Greg Dropkin
re: Cubic splines in package "mgcv" I don't have access to Gu (2002) but clearly the function R(x,z) defined on p126 of Simon Wood's book is piecewise quartic, not piecewise cubic. Like Kunio Takezawa (below) I was puzzled by the word "cubic" on p126. As Simon Wood writes, this basis is not actu

[R] Filtering a table

2011-08-16 Thread Santini Silvana
Hello, I have a big table with 3 columns and 103918 rows. This is the example,            time             species                 dbh 5 1 4.9377297 575 1 11.64127213 575 1 109.8182438 575 1 8.029809521 5 1 24.32501874 575 1 4.895992119 575 1 11.40567637 575 1 2.795090562 575 1 21

Re: [R] what can one do with (to) '..." ?

2011-08-16 Thread Carl Witthoft
Sorry - I wanted to dig a bit deeper than that. I certainly appreciate your point, as well as the other recent responses, but what I'm trying to figure out is: what does the last function called do to interpret the "..." ? Suppose I have: foo<-function(x,y,...){ z <-x+y plot(z,...) } I am

[R] Dates - week and year not day.

2011-08-16 Thread holdnatalie
Hi, I would be very grateful for some advice. I have read the help pages for Date, strptime, etc. All examples seem to use some version of day month year as date format. However I have Weekly composite data so ONLY want to input the dates as Week.Year (eg 35.2011). strptime seems to show this is p

[R] Defining "x" by names of columns in my dataset

2011-08-16 Thread Julie
Hello, I have a question about what I do wrong when I want to define "x" (and then I plan to define "y" and create a plot of lm(x,y)). > x <- (di(X.diktator20.), di(X.diktator200.), di (X.diktator2000.), > di(X.diktator2.)) Error: unexpected ',' in "x <- (di(X.diktator20.)," > x <- (di(X.dikta

Re: [R] Filtering a table

2011-08-16 Thread padmanabhan . vijayan
Have you tried subset after making your data into a dataframe? Regards VP Sent from my BlackBerry® smartphone from !DEA -Original Message- From: Santini Silvana Sender: r-help-bounces@r-project.orgDate: Tue, 16 Aug 2011 16:38:20 To: r-help@r-project.org Reply-To: Santini Silvana Subject

Re: [R] what can one do with (to) '..." ?

2011-08-16 Thread Duncan Murdoch
On 11-08-16 6:28 AM, Carl Witthoft wrote: Sorry - I wanted to dig a bit deeper than that. I certainly appreciate your point, as well as the other recent responses, but what I'm trying to figure out is: what does the last function called do to interpret the "..." ? Suppose I have: The best so

Re: [R] can't install plotrix

2011-08-16 Thread Jim Lemon
On 08/16/2011 04:50 AM, Alison Waller wrote: Hi all, I'm having problems installing plotrix. I tried installing it through install.packages, and from the unix command line, but each time it seems to stall when it is installing the help indices. has anyone had this same problem, is this packa

[R] Constructing an additional key inside of a lattice panel

2011-08-16 Thread Fredrik Karlsson
Hi, I would like to add an additional key inside of a panel based on a factor that is not the "groups" argument. I've tried using the panel.key function in latticeExtras, but I cannot get the line types the way I want it. Using my factor myGroups, I've tried this: panel.key(text=levels(myGroups)

Re: [R] Labelling all variables at once (using Hmisc label)

2011-08-16 Thread Frank Harrell
Do require(Hmisc); ?label to see the help file for label. It will show you how to do this: Monsieur Do wrote: > > The labels can contain much more than just names. In my case, they are > variable descriptions (items from a questionnaire). I need to keep the > names as they are, hence the need f

Re: [R] calibration curve for cph()

2011-08-16 Thread Frank Harrell
David Winsemius wrote: > > A combination of Predict (your newdata), cut2, and the plotting function > of your choice ought to suffice. But thought that cross-validation was an > option. Not at console at the moment (just off airplane.) > > Sent from my iPhone > > On Aug 15, 2011, at 5:26 PM, a

Re: [R] Defining "x" by names of columns in my dataset

2011-08-16 Thread Uwe Ligges
On 16.08.2011 11:01, Julie wrote: Hello, I have a question about what I do wrong when I want to define "x" (and then I plan to define "y" and create a plot of lm(x,y)). x<- (di(X.diktator20.), di(X.diktator200.), di (X.diktator2000.), di(X.diktator2.)) This is no R syntax (particularly

Re: [R] Font size R

2011-08-16 Thread Uwe Ligges
On 15.08.2011 23:31, Filoche wrote: Hi everyone. I'm using this following code: pdf(file="Fig5.pdf", width = 4.86, height = 6.29, pointsize = 10, family ='Times') par(mfcol = c(3,2), mai = c(0.4,0.8,0,0), omi = c(0.7, 0, 0.7, 0.1)); hist( rnorm(100) ) dev.off() When I open this in any vector

Re: [R] rJava and error messages

2011-08-16 Thread Uwe Ligges
Install an appropriate version of Java that fits to your R installation (i.e. 64-bit Java for 64-bit R and so o, but you have not told us any details as the psoting guide asks you to do). Uwe Ligges On 16.08.2011 01:40, Phil Schnarrs wrote: Hello All, I'm trying to load the rJava package

[R] Repeated measures cummulative logit mixed model

2011-08-16 Thread Jim Trabas
Dear R help gurus, I have the following problem and I would be delighted if you could help me. >From a large (1500) cohort of patients we have been taking some measurements (ECG measurements, but its not important). The measurements are ordinal in 4 grades (Grade I-IV, grade IV being the most s

Re: [R] Font size R

2011-08-16 Thread Filoche
Thank you for your answer. According to the help, they are suggesting to use "layout" which I did. However, font size is still reduced by the same factor. Here's my code: pdf(file="Fig5.pdf", width = 4.86, height = 6.29, family ='Times') nf = layout(matrix(c(1:4), 2, 2, byrow = TRUE)) par(ps =

[R] ggplot - some questions concerning histograms

2011-08-16 Thread Johannes Radinger
Hello, I am a beginner with ggplot and after doing simple graphs (histogram, segments etc.) some questions came up: 1) I tried to do a histogram, but nothing is displayed although it works with another vector. I think it is because of the very small values (n=1000, min=1.222e-24 max, 1.890e-20

Re: [R] Repeated measures cummulative logit mixed model

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 6:36 AM, Jim Trabas wrote: Dear R help gurus, I have the following problem and I would be delighted if you could help me. From a large (1500) cohort of patients we have been taking some measurements (ECG measurements, but its not important). The measurements are or

Re: [R] Repeated measures cummulative logit mixed model

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 9:07 AM, David Winsemius wrote: On Aug 16, 2011, at 6:36 AM, Jim Trabas wrote: Dear R help gurus, I have the following problem and I would be delighted if you could help me. From a large (1500) cohort of patients we have been taking some measurements (ECG measurem

Re: [R] Font size R

2011-08-16 Thread Uwe Ligges
On 16.08.2011 14:33, Filoche wrote: Thank you for your answer. According to the help, they are suggesting to use "layout" which I did. You have more control over the splitting, but the default reduction for "cex" still applies. I wonder: Why are you not resetting par("cex") to 1 before pr

Re: [R] Regression - how to deal with past values?

2011-08-16 Thread Eduardo M. A. M. Mendes
Yes, I have. As far as R packages go I found two packages: forecast (only deals with linear stuff) and tsDyn (deals with nonlinear models but considers no input). Cheers Ed On Aug 15, 2011, at 10:06 PM, Comcast wrote: > Have you done any searching (with for instance the term "forecast")? If

[R] Principal Components Analysis

2011-08-16 Thread Dunia Scheid
Hello, I am using the function princomp and I would like to get the coefficients of the PCA's! Would this be the rotation in the output or how can one get the coefficients of the PCA's? Many thanks, Dunia [[alternative HTML version deleted]] _

[R] Fit Gompertz' curve'

2011-08-16 Thread Silvano
Hi, I build a graph taking into account the times: 1, 2,4,6,8,10,12,15,18,21,24,28,32 and 48. Be that the scale of the X axis does not look right. It seems equidistant. (graph attached) What changes have I to do in the following commands so that the scale be correct? interaction.plot(Tem

Re: [R] Kappa distribution

2011-08-16 Thread Kingman, Albert (NIH/NIDCR) [E]
Richard: Were you able to locate a reference for the distribution of the kappa statistic. I cannot find one anywhere. Is the distribution known? There are many programs for generating the exact distribution of the statistics for a given set of marginals, but I have never seen a reference for

[R] PBSmapping, where is Ireland?!

2011-08-16 Thread Ewan Minter
Hi folks, I've been using 'PBSmapping' to make a map of Europe with some labels. I've been using the 'worldLL' PolyData, as my computer is too slow to make my own from the GSHHS files. The only problem is this PolyData does not seem to include Ireland. I have no idea why this should be so, other

Re: [R] Font size R

2011-08-16 Thread Filoche
Thank you sir for your help. I'll try to reset cex =1. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Font-size-R-tp3745762p3747271.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

Re: [R] Regression - how to deal with past values?

2011-08-16 Thread Mark Difford
On Aug 16, 2011 Eduardo M. A. M.Mendes wrote: > Can I gather from your email that there is nothing available on R that > deals > with dynamic models (k-step ahead and free-run)? Eduardo, There may be others, but try package dlm (Bayesian and Likelihood Analysis of Dynamic Linear Models) by Giov

[R] generalized inverse using matinv (Design)

2011-08-16 Thread Frank Paetzold
i am trying to use matinv from the Design package to compute the generalized inverse of the normal equations of a 3x3 design via the sweep operator. That is, for the linear model y = µ + x1 + x2 + x1*x2 where x1, x2 are 3-level factors and dummy coding is being used the matrix to be inverted i

[R] density plot with frequency units

2011-08-16 Thread r student
I would like to create a kernal density plot, but rather than show density units on the vertical axis I would like frequencies. I know histograms do this but I don't want the bars, just the density curve. Thanks! __ R-help@r-project.org mailing list h

Re: [R] deSolve, extracting variable values from inside ode function

2011-08-16 Thread Berend Hasselman
jamaas wrote: > > I'm just getting to grips with using ode function and have used the > examples and vignettes to produce a small model of a one-pool, > michaelis-menten, enzyme kinetic reaction. The rate of flux of substrate > into pool A is constant (fluxoa) however the rate of flux out of p

Re: [R] density plot with frequency units

2011-08-16 Thread Jeff Newmiller
This is a nonsensical request. It is like saying you want to plot the speed of a falling object but you want the units of speed to be meters. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Li

[R] Unusual separators

2011-08-16 Thread Matt Curcio
Hi all, I have a list that I got from a web page that I would like to crunch. Unfortunately, the list has some unusual separators in it. I believe the columns are separated by 1 space and 1 tab. I tried to insert this into the read.table( ..., sep=" \t", ...) but got an error that said something

[R] to search the tree using the branch and bound mathod!!!

2011-08-16 Thread jiliguala
hi, R users i have encountered a problem, i want to make a clusterring tree, than do the searching through the tree using "branch and bound" method. here is the code to make the tree, thanks for any ideas... d <- dist(data, method = "euclidean") h1 <- hclust(d, method="ward") plot(h1)

Re: [R] generalized inverse using matinv (Design)

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 10:15 AM, Frank Paetzold wrote: i am trying to use matinv from the Design package Which has been replaced by the rms package (about 2 years ago). to compute the generalized inverse of the normal equations of a 3x3 design via the sweep operator. That is, for the linear m

[R] Problems installing SJava

2011-08-16 Thread Luis Felipe Parra
Hello, I am trying to install SJava but I haven't been able to complete it successfully. I have tried to install it from bioconductor using the followin code and got the following output: > source("http://www.bioconductor.org/biocLite.R";) BioC_mirror = http://bioconductor.org Change using chooseB

Re: [R] generalized inverse using matinv (Design)

2011-08-16 Thread Doran, Harold
Frank, It is very rare that one needs to ever invert a matrix. This is particularly true if you are trying to solve a linear system of equations. Rather than offering advice to you on how to compute the inverse, can you indicate what you're trying to accomplish in the end? Maybe we can offer be

[R] Copulas and three vectors

2011-08-16 Thread Jakub Mikians
Hi i have a question about "copula" package ( http://cran.r-project.org/web/packages/copula/copula.pdf , http://www.jstatsoft.org/v21/i04/paper ) Using copulas, I want to generate three random vectors V1, V2 and V3, where both pairs (V1, V2) and (V1,V3) have the same dependency structure, defined

[R] Calibrating the risk free interest rate using nlminb

2011-08-16 Thread Newbie
Dear R-users I am trying to find a value for the risk free rate minimizing the difference between a BS call value with impl. volatilities minus the market price of a call (assuming this is just the average bid ask price) Here is my data: http://r.789695.n4.nabble.com/file/n3747509/S%26P_500_calls

Re: [R] density plot with frequency units

2011-08-16 Thread r student
Let me ask another way. Is there a way to create a histogram with a fitted line, but without bars? Or, perhaps draw the bars with invisible lines? Thanks. On Tue, Aug 16, 2011 at 7:29 AM, Jeff Newmiller wrote: > This is a nonsensical request. It is like saying you want to plot the speed > of

[R] exponential with decreasing

2011-08-16 Thread Komine
Hi everybody, I try to do an exponential model with decreasing. In my data, there is no data missing but there negative values. I adapted this following code whose the origin code comes from in this forum: Regress<-read.table("C:\\Users\\Regression.csv",sep=";",dec=",",header=TRUE) Regress f <-

[R] Bayesian Relative Survival Analysis in R?

2011-08-16 Thread #HE YAO FENG VINCENT#
Hi all, May i know does R has packages or code to run "Bayesian Relative Survival Analysis"? I have look through Bayesian Survival Analysis(2001) by Joseph George Ibrahim, Ming-Hui Chen

[R] p.adjust problem

2011-08-16 Thread m1ch43l
Hi, When I use the following code I get two different results, even though n is length(p) by default. - pvals <- c(5.722385e-02, NA, 1.018087e-01) p.adjust(pvals, method="bonferroni") p.adjust(pvals, method="bonferroni", n=length(pvals))

[R] exponential model with decreasing

2011-08-16 Thread Komine
Hi everybody, I try to do an exponential model with decreasing. In my data, there is no data missing but there negative values. I adapted this following code whose the origin code comes from in this forum: Regress<-read.table("C:\\Users\\Regression.csv",sep=";",dec=",",header=TRUE) Regress f <- f

[R] Text wrap

2011-08-16 Thread Filoche
Hi everyone. I have a long label that I would like to split. I found that I could use "strwrap" for simple text. However, this is not working with this label: str = expression(paste("< 20 µm phytoplankton ","(cells · ",mL^-1,")")) plot(, ylab = strwrap(str,20),...) I suspect this is because

Re: [R] Calibrating the risk free interest rate using nlminb

2011-08-16 Thread Berend Hasselman
Newbie wrote: > > Dear R-users > > I am trying to find a value for the risk free rate minimizing the > difference between a BS call value with impl. volatilities minus the > market price of a call (assuming this is just the average bid ask price) > > Here is my data: > > http://r.789695.n4.nab

[R] convert an xml object into a list on R 2.13

2011-08-16 Thread Samuel Le
Hi, I am manipulating xml objects using the package xml. With the version 2.10.1 this package included the function xmlToList that was converting the xml into a list straight away. This function seems to have gone when I moved to 2.13.0. Does someone has an equivalent for it? Thanks, S

Re: [R] p.adjust problem

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 11:17 AM, m1ch...@gmx-topmail.de wrote: Hi, When I use the following code I get two different results, even though n is length(p) by default. - pvals <- c(5.722385e-02, NA, 1.018087e-01) p.adjust(pvals, method="bonfer

Re: [R] exponential model with decreasing

2011-08-16 Thread Ben Bolker
Komine yahoo.fr> writes: > I try to do an exponential model with decreasing. In my data, there is no > data missing but there negative values. I adapted this following code whose > the origin code comes from in this forum: > Regress<-read.table("C:\\Users\\Regression.csv",sep=";",dec=",",header=T

[R] getting names of dimnames of xtabs into xtable latex output

2011-08-16 Thread Juliet Hannah
In R, the output of xtabs displays the names of the dimnames. In the example below, these are "change_diet" and "mydiet". Is there a way to have xtable incorporate these names directly into the latex output. Thanks for your help. table2 <- structure(c(26, 0, 40, 0, 10, 0, 188, 0, 281, 0), .Dim =

Re: [R] Text wrap

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 11:39 AM, Filoche wrote: Hi everyone. I have a long label that I would like to split. I found that I could use "strwrap" for simple text. However, this is not working with this label: plot(, ylab = strwrap(str,20),...) I suspect this is because I'm using "express

Re: [R] Text wrap

2011-08-16 Thread Marc Schwartz
On Aug 16, 2011, at 10:39 AM, Filoche wrote: > Hi everyone. > > I have a long label that I would like to split. I found that I could use > "strwrap" for simple text. However, this is not working with this label: > > str = expression(paste("< 20 µm phytoplankton ","(cells · ",mL^-1,")")) > > pl

Re: [R] Calibrating the risk free interest rate using nlminb

2011-08-16 Thread Newbie
I used: marketdata <- read.csv(file="S&P 500 calls, jan-jun 2010.csv", header=TRUE, sep=";") after changing my directory to where the file is saved. The data imported should be correct. The spot is equal to S0, I typed it double in the post, sorry for that. So S0 = 1136.03 is the spot -- View t

[R] Bayesian Relative Survival Analysis in R?

2011-08-16 Thread #HE YAO FENG VINCENT#
Hi all, May i know does R has packages or code to run "Bayesian Relative Survival Analysis"? I have look through Bayesian Survival Analysis(2001) by Joseph George Ibrahim Ming-Hui Chen, Debajyoti Sinha , and would like to try out bayesian relative survival analysis in R. >From http://cran.r-pro

Re: [R] Filtering a table

2011-08-16 Thread Dennis Murphy
Hi: You're in the neighborhood, but not quite there. >> dbhmean <- mean (exp1 [time==575 & species ==1]) This doesn't work because exp1 is a data frame, which has both rows and columns. You want to select the *rows* for which time = 575 and species = 1, so you either need to put a comma after sp

Re: [R] Calibrating the risk free interest rate using nlminb

2011-08-16 Thread Berend Hasselman
Newbie wrote: > > I used: > marketdata <- read.csv(file="S&P 500 calls, jan-jun 2010.csv", > header=TRUE, sep=";") > after changing my directory to where the file is saved. > The data imported should be correct. > The spot is equal to S0, I typed it double in the post, sorry for that. > So S0

[R] Assignment working differently inside ifelse()

2011-08-16 Thread Stuart Luppescu
Hello all, I need to extract rows and columns from a data frame and put them in a matrix. In some cases, there are no rows in the data frame meeting the selection criteria. For those rows I want to put a row of 0's in the matrix. Here's my clumsy code: tab1.m1 <- matrix(0, nrow=2, ncol=4) tab1.m1

Re: [R] ggplot - some questions concerning histograms

2011-08-16 Thread Dennis Murphy
Hi: On Tue, Aug 16, 2011 at 5:48 AM, Johannes Radinger wrote: > Hello, > > I am a beginner with ggplot and after doing simple graphs (histogram, > segments etc.) > some questions came up: > > 1) I tried to do a histogram, but nothing is displayed although it works with > another vector. > I thi

[R] Limit when reading in file?

2011-08-16 Thread Noah Silverman
Hello, I'm trying to read in a fairly large file into R, and am getting an odd error (65000 rows, 37 columns) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 25628 did not have 37 elements That line DOES have 37 elements. As A test, I tried deleting it, a

Re: [R] Bayesian Relative Survival Analysis in R?

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 10:48 AM, #HE YAO FENG VINCENT# wrote: Hi all, May i know does R has packages or code to run "Bayesian Relative Survival Analysis"? I have look through Bayesian Survival Analysis(2001) by Joseph George Ibrahim

[R] postscript( does not save the plot

2011-08-16 Thread Alaios
Dear all, I am using the following code to write the plot to an eps format postscript(file="test.eps",horizontal=FALSE) boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c

Re: [R] Limit when reading in file?

2011-08-16 Thread Sarah Goslee
Hi Noah, On Tue, Aug 16, 2011 at 1:25 PM, Noah Silverman wrote: > Hello, > > I'm trying to read in a fairly large file into R, and am getting an odd error > (65000 rows, 37 columns) > > Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : >  line 25628 did not have 37 el

Re: [R] Assignment working differently inside ifelse()

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 1:10 PM, Stuart Luppescu wrote: Hello all, I need to extract rows and columns from a data frame and put them in a matrix. In some cases, there are no rows in the data frame meeting the selection criteria. For those rows I want to put a row of 0's in the matrix. Here's my c

Re: [R] postscript( does not save the plot

2011-08-16 Thread Sarah Goslee
Hi, On Tue, Aug 16, 2011 at 1:32 PM, Alaios wrote: > Dear all, > I am using the following code to write the plot to an eps format > > postscript(file="test.eps",horizontal=FALSE) > > boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:5

Re: [R] postscript( does not save the plot

2011-08-16 Thread Marc Schwartz
On Aug 16, 2011, at 12:32 PM, Alaios wrote: > Dear all, > I am using the following code to write the plot to an eps format > > postscript(file="test.eps",horizontal=FALSE) > > boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],na

Re: [R] Fit Gompertz' curve'

2011-08-16 Thread Dennis Murphy
Hi: On Tue, Aug 16, 2011 at 7:07 AM, Silvano wrote: > Hi, > > I build a graph taking into account the times: 1, > 2,4,6,8,10,12,15,18,21,24,28,32 and 48. > > Be that the scale of the X axis does not look right. It seems equidistant. > (graph attached) (a) No graph came through. See the Posting G

Re: [R] Text wrap

2011-08-16 Thread Filoche
Thank you Mark for your help. It worked perfectly with 2 expression and mtext. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Text-wrap-tp3747574p3747884.html Sent from the R help mailing list archive at Nabble.com. __ R-

[R] FW: Bayesian Relative Survival Analysis in R?

2011-08-16 Thread #HE YAO FENG VINCENT#
Hi all, May i know does R has packages or code to run "Bayesian Relative Survival Analysis"? I have look through Bayesian Survival Analysis(2001) by Joseph George Ibrahim Ming-Hui Chen, Debajyoti Sinha , and would like to try out bayesian relative survival analysis in R. >From the cran project

Re: [R] Get significant codes from a model output fit with, GEE package

2011-08-16 Thread david oseguera montiel
Thank very much Dennis, I much appreciate your time and help. The example was very clear. Do you know if it is possible to get the variance do to the random effect or the correlation within random variable from the same reproducible example you post. I used to be able to get it when using a l

[R] Write vector/matrix in a loop

2011-08-16 Thread kokavolchkov
Hello! I'm trying to *save values* (*row and col*) in two matrices(1,m) or vectors. I have a loop, where a get these values: for(i in 144){ for(j in 73){ if(B4[i,j]==1){ # B4 is a matrix(73, 144) row <- B4[i-(i-1),j] col <-

Re: [R] Write vector/matrix in a loop

2011-08-16 Thread Ista Zahn
Hi, On Tue, Aug 16, 2011 at 1:31 PM, kokavolchkov wrote: > Hello! > > I'm trying to *save values* (*row and col*) in two matrices(1,m) or vectors. > I have a loop, where a get these values: > > for(i in 144){ >        for(j in 73){ >                if(B4[i,j]==1){ # B4 is a matrix(73, 144) >    

Re: [R] calibration curve for cph()

2011-08-16 Thread array chip
Dear Frank, Thanks for suggesting val.surv() function from rms package. It's exactly what I need. I tried the example on the help page and tweak towards to my situation, but got an error message. Could you suggestion what went wrong? library(rms) set.seed(123)  # so can reproduce re

Re: [R] Limit when reading in file?

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 1:33 PM, Sarah Goslee wrote: Hi Noah, On Tue, Aug 16, 2011 at 1:25 PM, Noah Silverman > wrote: Hello, I'm trying to read in a fairly large file into R, and am getting an odd error (65000 rows, 37 columns) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,

Re: [R] convert an xml object into a list on R 2.13

2011-08-16 Thread Duncan Temple Lang
Hi Samuel The xmlToList() function is still in the XML package. I suspect you are making some simple mistake like not loading the XML package or haven't installed it or are not capitalizing the name of the function correctly (you refer the xml package rather than by its actual name). You haven'

[R] What's your favourite R book that doesn't have R in the title?

2011-08-16 Thread Paul Miller
Hello All,   Recently, I discovered that there are appear to be some good R related books that don't have R in the title. For example, I'm currently reading Gellman and Hill's book Data Analysis using Regression and Multilevel/Hierarchical Models. The book uses R (and BUGS) but doesn't appear to

Re: [R] calibration curve for cph()

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 1:57 PM, array chip wrote: Dear Frank, Thanks for suggesting val.surv() function from rms package. It's exactly what I need. I tried the example on the help page and tweak towards to my situation, but got an error message. Could you suggestion what went wrong? It is

Re: [R] calibration curve for cph()

2011-08-16 Thread array chip
Oops, thank for reminding. I found that an in-house package interfered with rms package, which caused the error. Thanks David! John - Original Message - From: David Winsemius To: array chip Cc: Frank Harrell ; "r-help@r-project.org" Sent: Tuesday, August 16, 2011 11:27 AM Subject

Re: [R] Assignment working differently inside ifelse()

2011-08-16 Thread Stuart Luppescu
On Tue, 2011-08-16 at 12:10 -0500, Stuart Luppescu wrote: > but when I use the ifelse() as above, I get this: >[,1] [,2] [,3] [,4] > [1,] 0.0417 0.0417 0.0417 0.0417 > [2,] 0. 0. 0. 0. Oh, I see. ifelse() returns a value

Re: [R] What's your favourite R book that doesn't have R in the title?

2011-08-16 Thread Paul Miller
I can add one more title. The foundations of statistics: A simulation-based approach by Vasishth and Broe. Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/

[R] cuminc() in cmprsk package for cumulative incidence

2011-08-16 Thread array chip
Hi, To use cuminc() from cmprsk package, if a subject has 2 events (both the event of interest and the event of competing risk), should I create 2 observations for this subject in the dataset, one for each event with different fstatus (1 and 2), or just 1 observation with whatever event that

[R] Utilizing column names to multiply over all columns

2011-08-16 Thread Sam Albers
## Hello there, ## I have an issue where I need to use the value of column names to multiply with the individual values in a column and I have many columns to do this over. I have data like this where the column names are numbers: mydf <- data.frame(`2.72`=runif(20, 0, 125), `3.2

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 3:37 PM, Sam Albers wrote: ## Hello there, ## I have an issue where I need to use the value of column names to multiply with the individual values in a column and I have many columns to do this over. I have data like this where the column names are numbers: mydf <- data.fra

Re: [R] What's your favourite R book that doesn't have R in the title?

2011-08-16 Thread senne
I'm reading 'Statistics and Data Analysis for Financial Engineering ', some people might be turned off by the name, but actually it's pretty about everything, very easy to follow and have some good discussion. On Tue, Aug 16, 2011 at 2:14 PM, Paul Miller wrote: > Hello All, > > Recently, I discov

[R] trouble installing packages on OpenSuse 11.4

2011-08-16 Thread Dinesh
Hi, I am trying to install a bunch of packages via command line and can use some help in getting it right. My env is a freshly setup OpenSuse 11.4 on an amd desktop. I have not yet installed gcc (Will I need gcc to install packages? I have installed make, assuming R might need it.). I have tri

[R] cannot get to R2.13 using zypper in OpenSuse 11.4

2011-08-16 Thread Dinesh
Hi, I am trying to install R2.13 under OpenSuse 11.4 on an Intel desktop. I used the following instructions from (http://cran.r-project.org/bin/linux/suse/#sec-1_4): || |zypper ar -f http://download.opensuse.org/repositories/devel:languages:R:patched/openSUSE_11.4 R-patched| | then,| |zypper

[R] count dinucleotides in DNA using "count " function in "seqinr" package

2011-08-16 Thread Sara Kamali
  Dear all I want to count the number of dinucleotides of multiple DNA sequences from a csv file seprately using "count" function in "seqinr" package . it works for one sequence , but when I put this function in a for loop it gives zero for all nucleotides . i would be thankful if someone can h

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread Bert Gunter
How about: as.matrix(mydf[,1:3]) %*% diag(as.numeric(names(mydf)[1:3])) or scale(mydf[,1:3],1/as.numeric(names(mydf)[1:3])) ## ?scale to create your new columns? -- Bert On Tue, Aug 16, 2011 at 1:13 PM, David Winsemius wrote: > > On Aug 16, 2011, at 3:37 PM, Sam Albers wrote: > >> ## Hello

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread Bert Gunter
Sorry, my second should be: scale(mydf[,1:3],center = FALSE, scale=1/as.numeric(names(mydf)[1:3])) ## ?scale -- Bert On Tue, Aug 16, 2011 at 1:30 PM, Bert Gunter wrote: > How about: > > as.matrix(mydf[,1:3]) %*%  diag(as.numeric(names(mydf)[1:3])) > > or > >  scale(mydf[,1:3],1/as.numeric(nam

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread Sam Albers
Thanks for the response David. On Tue, Aug 16, 2011 at 1:13 PM, David Winsemius wrote: > > On Aug 16, 2011, at 3:37 PM, Sam Albers wrote: > >> ## Hello there, >> ## I have an issue where I need to use the value of column names to >> multiply with the individual values in a column and I have many

[R] How to use 'switch' with strings containing spaces?

2011-08-16 Thread Mauricio Cornejo
Hi, Does anyone know if the alternatives in the 'switch' function can be specified as strings containing spaces?  Neither of the two approaches below works. switch(expr, "Choice 1"="My first choice", "Choice 2"="My 2nd choice", "Choice 3"="My 3rd choice") x <- c("Choice 1", "Choice 2", "Choi

Re: [R] Query for semi-transparency support

2011-08-16 Thread Jesse Brown
Thanks for the pointer. I looked through the source and it seems that this is hard-coded into the device-specific files. Considering that, I can think of three ways I could achieve this behavior: 1 - Using .Device in a switch statement 2 - A try/catch construct that will trigger on warnings (

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread Hadley Wickham
>> You will get the warning that last last column is not "going right" but >> otherwise this returns what you asked for: >> >> sapply(1:length(mydf), function(i) mydf[[i]]* as.numeric(names(mydf)[i])  ) > > This suits my purposes well with a couple slight modifications: > > ## I made this into a da

[R] Chi square test on data frame

2011-08-16 Thread Bansal, Vikas
Dear all, I have been working on this problem from so many hours but did not find any solution. I have a data frame with 8 columns- V1 V2 V3 V4 W1 W2W3 W4 1 084 22 10 0 84 0 0 235840

[R] merge(join) problem

2011-08-16 Thread Sam Steingold
I have two datasets: A with columns Open and Name (and many others, irrelevant to the merge) B with columns Time and Name (and many others, irrelevant to the merge) I want the dataset AB with all these columns Open from A - a difftime (time of day) Time from B - a difftime (time of day) Name (same

  1   2   >