[R] Fitting Pattern-Mixture Models

2007-09-05 Thread Abdus Sattar
Dear R-user: Do you know any R package that could be use for fitting a Pattern-Mixture models (PMM) please? I would appreciate if you could suggest me a R package for fitting PMM. Thank you very much, Sincerely, Sattar

Re: [R] Embedding Audio Files in Interactive Graphs

2007-09-05 Thread Paul Murrell
Hi Michael Lawrence wrote: On 9/4/07, Sam Ferguson [EMAIL PROTECTED] wrote: Thanks for your reply Bruno. No - as I said, I know how to do that - the movie15 and the multimedia package are basically the same, and it is relatively straightforward to get an audio file into a pdf with them.

Re: [R] [Lattice] Incrase the height of strips in Trellis plots

2007-09-05 Thread Frede Aakmann Tøgersen
This should give you something close to what you want: xyplot(Petal.Length ~ Petal.Width | Species, iris, strip = strip.custom(par.strip.text = list(cex = 2)), par.settings = list(layout.heights=list(strip=1.45))) The par.settings argument alters locally the default par settings

[R] How to extract part of an array?

2007-09-05 Thread Lauri Nikkinen
Hi, How can I extract part of an array? I would like to extract table Supported from this array. If this is not possible, how do I convert array to list? I'm sorry this is not an reproducible example. spl - tapply(temp$var1, list(temp$var2, temp$var3, temp$var3), mean) spl , , Supported

Re: [R] capture.out(system())?

2007-09-05 Thread Gustaf Rydevik
On 9/4/07, Werner Wernersen [EMAIL PROTECTED] wrote: Hi, I am trying to capture the console output of program I call via system() but that always returns only character(0). For example: capture.output(system(pdflatex out.tex) ) will yield: character(0) and the output still written to

Re: [R] [Lattice] Incrase the height of strips in Trellis plots

2007-09-05 Thread Bernd Weiss
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Frede Aakmann Tøgersen schrieb: This should give you something close to what you want: xyplot(Petal.Length ~ Petal.Width | Species, iris, strip = strip.custom(par.strip.text = list(cex = 2)), par.settings =

[R] question about non-linear least squares in R

2007-09-05 Thread Yu (Warren) Wang
Hi, everyone, My question is: It's not every time that you can get a converged result from the nls function. Is there any solution for me to get a reasonable result? For example: x - c(-0.06,-0.04,-0.025,-0.015,-0.005,0.005,0.015,0.025,0.04,0.06) y -

Re: [R] [Lattice] Incrase the height of strips in Trellis plots

2007-09-05 Thread deepayan . sarkar
On 9/5/07, Frede Aakmann Tøgersen [EMAIL PROTECTED] wrote: This should give you something close to what you want: xyplot(Petal.Length ~ Petal.Width | Species, iris, strip = strip.custom(par.strip.text = list(cex = 2)), par.settings = list(layout.heights=list(strip=1.45))) The

Re: [R] Robust linear models and unequal variance

2007-09-05 Thread Geertje Van der Heijden
Thanks for your reply, Bert - it was really helpful! 1. I have used a non-parametric test of variance (fligner.test) to test whether the variances of my groups were equal or not, and they weren't. 2. Just quickly to see if I understand the weighting part - I calculate the variance of my

Re: [R] capture.out(system())?

2007-09-05 Thread Prof Brian Ripley
On Wed, 5 Sep 2007, Gustaf Rydevik wrote: On 9/4/07, Werner Wernersen [EMAIL PROTECTED] wrote: Hi, I am trying to capture the console output of program I call via system() but that always returns only character(0). For example: capture.output(system(pdflatex out.tex) ) will yield:

Re: [R] question about non-linear least squares in R

2007-09-05 Thread Moshe Olshansky
Below is one possibility: If you knew MA you would get a regular linear least-squares for parameters A,B and constant which can be easily solved. So now you can define a function f(MA) which returns that value. Now you must minimize that f - a function of one argument. It can have several local

Re: [R] Choosing the optimum lag order of ARIMA model

2007-09-05 Thread Megh Dal
Hi Leeds, Thanx for this reply. Actually I did not want to know whether any differentiation is needed or not. My question was that : what is the difference between two models : arima(data, c(2,1,2)) and arima(diff(data), c(2,0,2)) If I am correct then those two models

Re: [R] Pie Chart Labels

2007-09-05 Thread Jim Lemon
Adam Green wrote: I am having trouble finding out how to adjust the position of labels on pie charts. For the small wedges, many of the labels overlap making it impossible to read. Is there any way to offset the labels so that they don't overlap? Hi Adam, There are three ways to adjust

Re: [R] How to extract part of an array?

2007-09-05 Thread Peter Dalgaard
Lauri Nikkinen wrote: Hi, How can I extract part of an array? I would like to extract table Supported from this array. If this is not possible, how do I convert array to list? I'm sorry this is not an reproducible example. spl - tapply(temp$var1, list(temp$var2, temp$var3, temp$var3),

Re: [R] lattice xyplot with bty=l

2007-09-05 Thread Patrick Drechsler
Deepayan Sarkar [EMAIL PROTECTED] writes: On 9/4/07, Patrick Drechsler [EMAIL PROTECTED] wrote: what is the correct way of removing the top and right axes completely from a lattice xyplot? I would like to have a plot similar to using the bty=l option for traditional plots. There is no

Re: [R] integers

2007-09-05 Thread [EMAIL PROTECTED]
On 9/4/07, Christoph Heibl [EMAIL PROTECTED] wrote: Hi list, The function is.integer tests if an object is of type integer: see e.g.: is.integer(12) # FALSE is.real(12) # TRUE mode(12)# numeric But how can I test if a number is actually an integer? R seek is

[R] Running geeglm unstructured corstr

2007-09-05 Thread Niccolò Bassani
Dear R users, I've got a serious problem running some gee functions, and I really can't fix it. My dataframe is made of several rows and columns (say 7600 x 15), like the one below: header inr . inside group_cod 1 2.25 0 1 1

Re: [R] Choosing the optimum lag order of ARIMA model

2007-09-05 Thread Prof Brian Ripley
On Wed, 5 Sep 2007, Megh Dal wrote: Hi Leeds, Thanx for this reply. Actually I did not want to know whether any differentiation is needed or not. My question was that : what is the difference between two models : arima(data, c(2,1,2)) and arima(diff(data), c(2,0,2)) If I am

Re: [R] plotting

2007-09-05 Thread yoooooo
This looks like exactly what i want!! Thanks! Jim Lemon-2 wrote: yoo wrote: Hi, let's say I have data x = c(1, 2, 10, 12) y = c(100, -20, 50, 25) if I go plot(x, y), then the default x-axis range goes from 1 to 12. Is there a way to change it so that the axis looks like:

Re: [R] Different behavior of mtext

2007-09-05 Thread Greg Snow
You may also want to look at the cnvrt.coords function in the TeachingDemos package. It may be a bit simpler than mixing grid and base. -Original Message- From: Sébastien [EMAIL PROTECTED] To: Prof Brian Ripley [EMAIL PROTECTED] Cc: R-help r-help@stat.math.ethz.ch Sent: 9/3/07 7:46 PM

Re: [R] Help: how can i build a constrained non-linear model?

2007-09-05 Thread 维娜 缪
Dear all I try to run the code as follows, test.model-nls(y~exp(A)*(x-PMA)^4+exp(B)*(x-PMA)^2+Const, data=test, start=list(A=8,B=5,Const=10,PMA=0), control=nls.control(maxiter = 50,minFactor=1/1048), trace=TRUE) But how can i build a selfSart, since i have much data ? Thanks for your help

[R] Spline

2007-09-05 Thread excalibur
I want to interpole a functione by a spline interpolation and i want to know if i can force, with any function or parameter, the interpolation to be monotonic. Thanks all -- View this message in context: http://www.nabble.com/Spline-tf4384168.html#a12498336 Sent from the R help mailing list

[R] length of a string

2007-09-05 Thread João Fadista
Dear all, I would like to know how can I compute the length of a string in a dataframe. Example: SEQUENCE ID TGCTCCCATCTCCACGGHR04FS00645 ACTGAACTCCCATCTCCAAT HR0595847847 I would like to know how to compute the length of each SEQUENCE.

Re: [R] length of a string

2007-09-05 Thread Bill.Venables
sLengths - with(dataFrame, nchar(as.character(SEQUENCE))) Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826 7251 Fax (if absolutely necessary): +61 7 3826 7304 Mobile: +61 4 8819 4402 Home Phone:

[R] For loop with if else statement

2007-09-05 Thread Monica Pisica
Hans, I think your problem is that you don't use the variable which takes different values in your if statement your i changes values and has really nothing to do with your x variable (except the length part ). Also all the other variables need to be declared somehow - otherwise how

Re: [R] length of a string

2007-09-05 Thread Jared O'Connell
How's this? x = data.frame(ID=c(asdf,asdfasdf),1:2) x ID X1.2 1 asdf1 2 asdfasdf2 nchar(as.character(x$ID)) [1] 4 8 Assuming ID is a factor, if not, you can remove the as.character(). On 9/5/07, João Fadista [EMAIL PROTECTED] wrote: Dear all, I would like to know

Re: [R] length of a string

2007-09-05 Thread Chuck Cleland
João Fadista wrote: Dear all, I would like to know how can I compute the length of a string in a dataframe. Example: SEQUENCE ID TGCTCCCATCTCCACGGHR04FS00645 ACTGAACTCCCATCTCCAAT HR0595847847 I would like to know how to

Re: [R] length of a string

2007-09-05 Thread Paul Smith
On 9/5/07, João Fadista [EMAIL PROTECTED] wrote: I would like to know how can I compute the length of a string in a dataframe. Example: SEQUENCE ID TGCTCCCATCTCCACGGHR04FS00645 ACTGAACTCCCATCTCCAAT HR0595847847 I would like to know

Re: [R] length of a string

2007-09-05 Thread Henrique Dallazuanna
Hi, sapply(levels(df[,SEQUENCE]), nchar) Where 'df' is your data.frame -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 05/09/07, João Fadista [EMAIL PROTECTED] wrote: Dear all, I would like to know how can I compute the length of a string in a dataframe.

Re: [R] length of a string

2007-09-05 Thread Ted Harding
On 05-Sep-07 13:50:57, João Fadista wrote: Dear all, I would like to know how can I compute the length of a string in a dataframe. Example: SEQUENCE ID TGCTCCCATCTCCACGGHR04FS00645 ACTGAACTCCCATCTCCAAT HR0595847847 I would like

[R] geotiff or tiff files with world files

2007-09-05 Thread Monica Pisica
Hi, I have a matrix of data which i can vizualize as an image - for example. I would like to save this image as a geotiff file or at a tiff file with a world file which holds the projection of my data (ultimately the data represent a map of some sort). I know i can save the data as an ESRI

Re: [R] length of a string

2007-09-05 Thread Benilton Carvalho
As long as you keep in mind Prof. Ripley's comment, you're going to be fine with nchar(). http://tolstoy.newcastle.edu.au/R/e2/devel/07/05/3450.html Remember that what you want exactly is given by nchar(obj, type=chars), which is **NOT** the default on R 2.5.1 (only on R-2.6.0). In your

[R] multivariate ARMA simulation

2007-09-05 Thread hanwen zhang
Dear Sirs: I am trying to simulate a ARMA multivariate model using AR-array(c(1,0.5,0,0.1,0,0.4,1,0.8),c(2,2,2)) mod- ARMA(A=AR, B=diag(1,2),C=NULL) y-simulate(mod,sampleT=100) in the package dse1, but how can I specify the covariance matrix for the noise of the model? and does the

[R] Multiple xyplots

2007-09-05 Thread Tom Wright
Hi everyone, I'm hoping you can give me some pointers. I have a requirement to draw multiple (103) xy line plots onto one output device. Ideally the plots should be displayed in a hexagonal grid (example at www.maladmin.com/example.jpg). I can calculate the locations for each waveform but am

Re: [R] Q: selecting a name when it is known as a string

2007-09-05 Thread D. R. Evans
D. R. Evans said the following at 09/04/2007 04:14 PM : I am 100% certain that there is an easy way to do this, but after I have reconsidered this and now believe it to be essentially impossible (or at the very least remarkably difficult) although I don't understand why it is so :-( At least, I

Re: [R] bootstrap confidence intervals with previously existing bootstrap sample

2007-09-05 Thread Tim Hesterberg
On Tue, 4 Sep 2007, [EMAIL PROTECTED] wrote: I am new to R. I would like to calculate bootstrap confidence intervals using the BCa method for a parameter of interest. My situation is this: I already have a set of 1000 bootstrap replicates created from my original data set. I have already

Re: [R] How to obtain intercept statistics in anova withwithin-subject factors?

2007-09-05 Thread Greg Snow
Sorry, I did not think about the nested design (did not read carefully enough). Another thing to try (untested) is to create a column of 1's and include that specifically and exclude the default intercept, then your column of 1's acts as the intercept, but a p-value is returned from it. Note

Re: [R] Multiple xyplots

2007-09-05 Thread deepayan . sarkar
On 9/5/07, Tom Wright [EMAIL PROTECTED] wrote: Hi everyone, I'm hoping you can give me some pointers. I have a requirement to draw multiple (103) xy line plots onto one output device. Ideally the plots should be displayed in a hexagonal grid (example at www.maladmin.com/example.jpg). I can

[R] Monotone splines

2007-09-05 Thread servien remi
Hello, i have a little problem with R and i hope you can help me. I want to use splines to estimate a function but i want to force the interpolation to be monotone. Is this possible with R ? Thank you, Rémi. - [[alternative

Re: [R] question about non-linear least squares in R

2007-09-05 Thread apjaworski
Here is one way of getting a reasonable fit: 1. Scale your y's by dividing all values by 1e6. 2. Plot x vs. y. The plot looks like a quadratic function. 3. Fit a quadratic const. + B*x^2 - this a linear regression problem so use lm. 4. Plot the predictions. 5. Eyball the necessary shift -

[R] ecological meaning of randomForest vegetation classification?

2007-09-05 Thread Christoph Muller
Hi, everyone, I haven't found anything similar in the forum, so here's my problem (I'm no expert in R nor statistics): I have a data set of 59.000 cases with 9 variables each (fractional coverage of 9 different plant types, such as deciduous broad-leaved temperate trees or evergreen tropical

Re: [R] kendalls tau c

2007-09-05 Thread Uwe Ligges
Barbara Diane-Spillmann wrote: dear all, does anybody know if cor.test with method=kendall calculates kendalls tau a b or c? I need to get p values for kendalls tau c... May I ask what the difference between Kendall's tau a, b and c is? Any references? Uwe Ligges thank you very much

Re: [R] Single plot multiple levels in x?

2007-09-05 Thread Richard Yanicky
Greg, This is great, exactly what I was looking for. Thanks. Rich -Original Message- From: Greg Snow [EMAIL PROTECTED] Sent: Aug 31, 2007 2:55 PM To: Richard Yanicky [EMAIL PROTECTED], Uwe Ligges [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: RE: [R] Single plot multiple

[R] level names with groupdedData object

2007-09-05 Thread Dean Sonneborn
How do I get a grouped data object to use the level names from the input data set? first I gave the levels some names like this: male -factor(male) levels(male) - c(“Girls”,”Boys”) Then I created a groupdedData object but the male variable in not part of the grouping formula. Then I fit an

Re: [R] element wise opertation between a vector and a list

2007-09-05 Thread Greg Snow
?mapply mapply('+', a, b, SIMPLIFY=FALSE) colSums(mapply('+', a, b)) 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 PROTECTED] On

[R] list element to matrix

2007-09-05 Thread dverzi
I have created a list of matrices using sapply or lapply and wish to extract each of the matrices as a matrix. Some of them are 2x2, 3x3, etc. I can do this one at a time as: M1-as.matrix(D[[1]]) How can repeat this process for an unknown number of entries in the list? In other words, how

Re: [R] ecological meaning of randomForest vegetation classification? [Broadcast]

2007-09-05 Thread Liaw, Andy
Hi Christoph, I'm not exactly sure what you're looking for, but I'll take a stab anyway. The trees in a random forest is not designed to be interpreted as one would with an ordinary tree. There are several things you may try to see if they help you any. One is the distribution of votes. It

[R] Lattice: key with expression function

2007-09-05 Thread Folkes, Michael
HI all, I'm trying (unsuccessfully) to add the degree symbol to each line of text in my legend (within xyplot). Here is the line of code, which fails to interpret the expression function: auto.key =list(points = FALSE,text=paste(levels(as.factor(divertSST2$temp)),expression(degree)). ..), I just

Re: [R] rug() colors

2007-09-05 Thread Greg Snow
You could make multiple calls to the rug function using a different color for each call. Using tapply or by may automate this for you. Another option would be to create your own rug using the segments function (which will plot multiple colors). Hope this helps, -- Gregory (Greg) L. Snow Ph.D.

Re: [R] Lattice: key with expression function

2007-09-05 Thread deepayan . sarkar
On 9/5/07, Folkes, Michael [EMAIL PROTECTED] wrote: HI all, I'm trying (unsuccessfully) to add the degree symbol to each line of text in my legend (within xyplot). Here is the line of code, which fails to interpret the expression function: auto.key =list(points =

Re: [R] Q: selecting a name when it is known as a string

2007-09-05 Thread Greg Snow
If your main goal is to do a loess fit, then make predictions from that, then using the 'get' function may do what you want: tmp.var - get(ORDINATE) lo - loess(percent ~ ncms * tmp.var, d, ... grid - expand.grid(tmp.var=MINVAL:MAXVAL, ncms=MINCMS:MAXCMS) predict(lo, grid) Here you stick with

Re: [R] Multiple xyplots

2007-09-05 Thread Greg Snow
Take a look at the my.symbols function in the TeachingDemos package. The last example shows how to create a hexagonal grid and the 2nd to last example shows how to plot several small line plots onto a larger plot. Combining these 2 examples should give you what you want. Hope this helps, --

[R] list element to matrix

2007-09-05 Thread Friedrich Schuster
You get the number of list elements with length(D), the dimensions of M1 with dim(M1) see help with: ?dim ?length Hope this helps... I have created a list of matrices using sapply or lapply and wish to extract each of the matrices as a matrix. Some of them are 2x2, 3x3, etc. I can do this

Re: [R] Q: selecting a name when it is known as a string

2007-09-05 Thread Tony Plate
For the column names of the result of expand.grid(), I would just assign them the values I wanted, like this: x - expand.grid(tmp=1:3,y=1:2) x tmp y 1 1 1 2 2 1 3 3 1 4 1 2 5 2 2 6 3 2 colnames(x)[1] - whatever x whatever y 11 1 22 1 33 1 4

[R] Round Off Error Variance

2007-09-05 Thread Remund, Todd
I am trying to specify a round off error distribution, but I am not sure what the variance of round off error would be for R. Does anyone have a suggestion? Thanks Todd Remund (435) 863-8172 Science Engineering [[alternative HTML version deleted]]

[R] Question about making array dataset inside a package

2007-09-05 Thread Wallace Hui
Hello I have a question about how I can include an array dataset inside a package. In our package, one R function is designed to take an array of 2 rows * 2 columns * k levels as input data enter by the user, where k is positive integers. I am trying to include a 3-D array of 2-by-2-by-8

Re: [R] Question about making array dataset inside a package

2007-09-05 Thread Kuhn, Max
Please read http://cran.r-project.org/doc/manuals/R-exts.html especially Section 1.1.3. Use save to create an Rdata file. Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wallace Hui Sent: Wednesday, September 05, 2007 4:18 PM To:

Re: [R] Lattice: key with expression function

2007-09-05 Thread Folkes, Michael
Thanks to Deepayan...again, for suggesting parse. Here is how I added the degree symbol to a vector of text for my xyplot legend: auto.key =list(points = FALSE,text=parse(text = paste(levels(as.factor(divertSST2$temp)), *degree, sep = ))), For me the tricky part was learning about adding the

Re: [R] list element to matrix

2007-09-05 Thread jim holtman
If they are already a matrix in the list, then you don't have to use 'as.matrix'; you can just say: M1 - D[[1]] Now the question is, what do you mean by how do you index M1? Do you want to go through the list applying a function to each matrix? If so, then just 'lapply'. For example, to get

[R] writing elements in list as a data frame

2007-09-05 Thread Srinivas Iyyer
Dear R-helpers, Lists in R are stumbling block for me. I kindly ask you to help me able to write a data-frame. I have a list of lists. sls[1:2] $Andromeda_maya1 x y [1,] 369 103 [2,] 382 265 [3,] 317 471 [4,] 169 465 [5,] 577 333 $Andromeda_maya2 x y [1,] 173 507 [2,]

Re: [R] writing elements in list as a data frame

2007-09-05 Thread jim holtman
Try this: sls - list(a=matrix(sample(10), ncol=2, dimnames=list(NULL, c('x', 'y'))), + b=matrix(sample(16), ncol=2, dimnames=list(NULL, c('x', 'y' sls $a x y [1,] 8 2 [2,] 9 10 [3,] 4 1 [4,] 5 7 [5,] 3 6 $b x y [1,] 4 14 [2,] 3 15 [3,] 16 5 [4,] 1 9 [5,] 8 7

[R] confidence intervals of proportions from complex surveys

2007-09-05 Thread Dirk Enzmann
This is partly an R and partly a general statistics question. I'm trying to get confidence intervals of proportions (sometimes for subgroups) estimated from complex survey data. Because a function like prop.test() does not exist for the survey package I tried the following: 1) Define a survey

[R] question: randomization t-test function already defined in R?

2007-09-05 Thread Karen.Green
Dear R Users, I am hoping you can help me. I have received code from a colleague who uses Matlab. I need to translate it into R. I am wondering if there is a randomization t-test (from non-parametric statistics) function already defined in R. (In Matlab the function is randtest.m.)

Re: [R] question: randomization t-test function already defined in R?

2007-09-05 Thread Achim Zeileis
On Wed, 5 Sep 2007, [EMAIL PROTECTED] wrote: Dear R Users, I am hoping you can help me. I have received code from a colleague who uses Matlab. I need to translate it into R. I am wondering if there is a randomization t-test (from non-parametric statistics) function already defined in R.

[R] change all . to 0 in a data.frame

2007-09-05 Thread Dieter Best
Hello, I read in a tab delimited text file via mydata = read.delim(myfile). The text file was originally an excel file where . was used in place of 0. Now all the columns which should be integers are factors. Any ideas how to change all the . to 0 and factors back to integer? Thanks a lot

Re: [R] change all . to 0 in a data.frame

2007-09-05 Thread jim holtman
Here is one way. You might want to read in the data with 'as.is=TRUE' to prevent conversion to factors. x - data.frame(a=c(1,2,3,'.',5,'.')) str(x) 'data.frame': 6 obs. of 1 variable: $ a: Factor w/ 5 levels .,1,2,3,..: 2 3 4 1 5 1 # replace '.' with zero; either readin with 'as.is=TRUE'

[R] The variables combined in a table from other table and combination questions

2007-09-05 Thread leeznar
Dear All: I need to have some data frame objects. First aa object: pH Formulation time Subject [1]1.2 F 0 1 [2]7.4 S 1 2 [3]MF 2 3 [4] 3 4 [5] ni Then, I need to produce 2*3(pH*formulation)

[R] Rggobi compilation error: display.c

2007-09-05 Thread Yuelin Li
On a ubuntu linux computer (Feisty, i386), I compile R and additional packages from source. The compiler is gcc 4.1.2. The problem is, I can run sudo R and successfully compile all packages (e.g., MASS, lattice) except rggobi. The error seems to be in display.c. My ggobi is in /usr/local/,

Re: [R] element wise opertation between a vector and a list

2007-09-05 Thread Charles C. Berry
On Wed, 5 Sep 2007, Greg Snow wrote: ?mapply mapply('+', a, b, SIMPLIFY=FALSE) colSums(mapply('+', a, b)) or sapply( a, sum ) + b * sapply( a, length ) or even sapply( a, sum ) + b * 2 if all list components in 'a' are of length 2. Then there are the do.call( cbind , a )