Re: [R] silhouette: clustering labels have to be consecutive intergers starting

2007-10-10 Thread Tao Shi
Thank you very much, Benilton and Prof. Ripley, for the speedy replies! Looking forward to the fix! Tao From: Prof Brian Ripley [EMAIL PROTECTED] To: Benilton Carvalho [EMAIL PROTECTED] CC: Tao Shi [EMAIL PROTECTED], [EMAIL PROTECTED], r-help@r-project.org Subject: Re: [R]

[R] global object in user defined function

2007-10-10 Thread Murray Pung
I need an object created in a user defined function to be accessible to another user defined function. I am fairly certain the object is correctly created as it prints when I use the return() function, however the 2nd function seems unable to use it. I am guessing objects created in functions are

[R] please help me

2007-10-10 Thread azadeh sadeghian
dear list I am student M.S. statistics in department statistics . I am working in the function nls in the [R 2.3.1] with 246 data and want to fit the exp model to vectors( v and u ) but I have a problem to use it u 5.00e-13 2.179057e+03 6.537171e+03 1.089529e+04 1.525340e+04

Re: [R] Multivariate chi-square distribution function

2007-10-10 Thread Robin Hankin
Hello If you want the multivariate t-distribution, use rmvt() of the mvtnorm package. If you want the Wishart distribution, one can write a little nonce function: library(mvtnorm) rwis - function(n,sigma){ crossprod(rmvnorm(n,sigma=sigma)) } I'm not sure what you mean by the multivariate

[R] R Graphical Manuals Web API

2007-10-10 Thread 小笠原理
Dear all, As a response to the comment of Mr. Romain Francois, I wrote a small set of REST web APIs for R Graphical Manuals. It has become possible to get image URLs for a given package/function name via the web API. http://cged.genes.nig.ac.jp/RGM2/webAPI.php Any comment would be gratefully

Re: [R] Multivariate chi-square distribution function

2007-10-10 Thread Dimitris Rizopoulos
Hi, in order to define multivariate distribution functions with known marginals, you can also use the copula package, e.g., library(copula) x - mvdc(normalCopula(0.75), c(gamma, gamma), list(list(shape = 2, rate = 3), list(shape = 3, rate = 2))) x.samp - rmvdc(x, 100) dmvdc(x, x.samp)

Re: [R] please help me

2007-10-10 Thread Gabor Grothendieck
You need better starting values: f - function(x) { c0 - x[1]; ce - x[2]; ae - x[3] sum((v - c0+(ce*(1-exp((-u)/ae^2) } g - 4^(0:8) g - c(-g, g) g - expand.grid(c0 = g, ce = g, ae = g) start - g[which.min(apply(g, 1, f)), ] nls(v ~ c0+(ce*(1-exp((-u)/ae))), data = data1, start = start) On

[R] error message with option checkBuild in update.packages in R 2.6.0

2007-10-10 Thread Rainer M Krug
Hi System: Linux Open SuSE 10.2 I upgraded to R 2.6.0 and wanted to upgrade my packages as well. I tried to use the checkBuild=TRUE option in update.packages, it asked me if I wanted to update the package and I answered with yes, and finally ig tave me the error message unknown parameter

[R] save lm output into vectors

2007-10-10 Thread Jiong Zhang, PhD
Hi, May I ask how I can save the coefficients and the p values into a table? thanks. jiong The email message (and any attachments) is for the sole...{{dropped:11}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Problem with RCMD CHECK (or BUILD)

2007-10-10 Thread Markus Gesmann
Dear Olivier, I had the same problem the other day. It is important that you set the PATH in the right order. I use the Rtools set from http://www.murdoch-sutherland.com/Rtools/ and created a little batch file to set the PATH in the right order, please see below:

Re: [R] please help me

2007-10-10 Thread Dieter Menne
azadeh sadeghian a.sadeghian1386 at yahoo.com writes: I am student M.S. statistics in department statistics . I am working in the function nls in the [R 2.3.1] You should update to a more recent version of R (2.6.0 is current) with 246 data and want to fit the exp model to vectors( v and

Re: [R] R Graphical Manuals Web API

2007-10-10 Thread Friedrich Schuster
Great idea, thanks! 小笠原理 wrote: Dear all, As a response to the comment of Mr. Romain Francois, I wrote a small set of REST web APIs for R Graphical Manuals. It has become possible to get image URLs for a given package/function name via the web API.

Re: [R] error message with option checkBuild in update.packages in R2.6.0

2007-10-10 Thread Rainer M Krug
Van Campenhout Bjorn wrote: I upgraded to R 2.6.0 and wanted to upgrade my packages as well. I tried to use the checkBuild=TRUE option in update.packages, it asked me if I wanted to update the package and I answered with yes, and finally ig tave me the error message unknown parameter

[R] detecting finite mixtures

2007-10-10 Thread Lngmyers
This question teeters on the brink of general statistics rather than an R-specific issue, but I'm hoping it boils down to how I coded VR's EM algorithm for finite mixture modeling and not something worse (i.e. that my plan is impossible). Briefly, I'm trying to simulate an experiment where

[R] subsetting a data.frame

2007-10-10 Thread João Fadista
Dear all, I would like to be able to subset a data.frame in a special way. I will put here an example: Score Name 88 19_0070 88 19_0070 87 19_0070 79 002127_0658 79 002127_0658 77 002127_0658 So, for the

Re: [R] AlgDesign--exact and approximate design

2007-10-10 Thread sun
Thanks, Steve. I have read that document a bit, seems I need read it more. I have 6 variables, all factors. 3^2 and 4^4 the following is the code require(AlgDesign) set.seed(1) levels = c(v1=2,v2=2, v3=4,v4=4,v5=4,v6=4)

[R] Using expression for Italics and object evaluation in plot title

2007-10-10 Thread Daniel Brewer
Hi, I am trying to get a title on a plot that contains both some formatting and prints the value of an object. What I have been using to get the italics is: title(sub=expression(paste(Log-rank test ,italic(p),-value = ,p.val))) But this prints p.val rather than the object value. I have tried

[R] Data manipulation question

2007-10-10 Thread Julien Barnier
Hi all, Suppose I have the following data.frame, with an id column and two variables columns : idX Y 0001 NA 21 0002 NA 13 0003 000145 0004 NA 71 0005 000320 What I would like to do is to create a new variable Z whose values are the

Re: [R] window (x,y) co-ordinates of datapoints

2007-10-10 Thread Jim Lemon
Alberto Monteiro wrote: Prof Brian Ripley wrote: Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? Why worry about that, Alberto, when you can

Re: [R] How do I obtain the design matrix of an lm()?

2007-10-10 Thread Prof Brian Ripley
?model.matrix On Tue, 9 Oct 2007, Ajay Shah wrote: I am using the clever formula notation of R to first do an OLS. E.g. I say m - lm(y ~ x + f) where f is a factor, and R automatically constructs the dummy variables. Very nice. I need to then go on to do some other ML estimation using

Re: [R] error message with option checkBuild in update.packages in R 2.6.0

2007-10-10 Thread Prof Brian Ripley
On Wed, 10 Oct 2007, Rainer M Krug wrote: Hi System: Linux Open SuSE 10.2 I upgraded to R 2.6.0 and wanted to upgrade my packages as well. I tried to use the checkBuild=TRUE option in update.packages, it asked me if I wanted to update the package and I answered with yes, and finally ig

Re: [R] Help with gamm errors

2007-10-10 Thread Simon Wood
Rob, It might be worth upgrading at least mgcv and MASS to the current versions (latest mgcv is 1.3-28, just gone to CRAN). Way back I vaguely remember that there was an issue with glmmPQL (called by gamm) not picking up correlation structure variables from the dataframe, but I can't now find

Re: [R] How do I obtain the design matrix of an lm()?

2007-10-10 Thread Gavin Simpson
On Tue, 2007-10-09 at 20:04 +0530, Ajay Shah wrote: I am using the clever formula notation of R to first do an OLS. E.g. I say m - lm(y ~ x + f) where f is a factor, and R automatically constructs the dummy variables. Very nice. I need to then go on to do some other ML estimation

[R] How do I obtain the design matrix of an lm()?

2007-10-10 Thread Ajay Shah
I am using the clever formula notation of R to first do an OLS. E.g. I say m - lm(y ~ x + f) where f is a factor, and R automatically constructs the dummy variables. Very nice. I need to then go on to do some other ML estimation using the same design matrix that's used for the OLS. I could,

[R] Current status of Sweave PNG functionality

2007-10-10 Thread amternes
Hi, I was looking for a way to make Sweave output not only EPS and PDF, but also PNG. Searching through the R mailing list archives, I found the following post from Thibaut Jombard: https://stat.ethz.ch/pipermail/r-help/2006-March/102122.html and

[R] average waveform over many cycles

2007-10-10 Thread Bill Simpson
I have 400 cycles of a noisy waveform. I would like to find the average (over the 400 cycles) of one cycle. Please tell me to do it in R. Any suggestions welcome! Thanks very much for any help. Bill __ R-help@r-project.org mailing list

[R] chi2

2007-10-10 Thread elyakhlifi mustapha
Hello, I want to use the quantile function so I read the doc but I don't understand with this qchisq(seq(0.05,0.95,by=0.05),df=(length(don)-1)) [1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39 63160.27 63205.65 63250.33 63295.04 63340.48 63387.48 63437.03 63490.53 63550.14

Re: [R] Problem with RCMD CHECK (or BUILD)

2007-10-10 Thread Prof Brian Ripley
We do recommend Rcmd build mpkg to build a source package, followed by Rcmd INSTALL --build mypkg_ver.tar.gz to install it and zip up a version for distribution. It is 'check' and 'build', and I believe R should refuse to use CHECK or BUILD (as in does on all other platforms and at one time

Re: [R] Visualize cox proportional hazards

2007-10-10 Thread Armin Goralczyk
On 10/9/07, Christos Hatzis [EMAIL PROTECTED] wrote: There are at least a couple of versions of such plots. Search for forest plots: help.search(forest plot) Hi Christos Could you be more specific? On my system I found nothing: help.search(forest plot) No help files found matching 'forest

[R] Plotting two distance matrices

2007-10-10 Thread Jari Oksanen
I'm trying to plot two distance matrices against each other (74x74,phylogenetic distance and phenotypic distances). However R gives an error message:Error in plot.new() : figure margins too large. Is it because I have too many points to plot? No. It *sounds* like you don't have distance

Re: [R] chi2

2007-10-10 Thread Ben Bolker
elyakhlifi mustapha wrote: Hello, I want to use the quantile function so I read the doc but I don't understand with this qchisq(seq(0.05,0.95,by=0.05),df=(length(don)-1)) [1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39 63160.27 63205.65 63250.33 63295.04 63340.48

Re: [R] chi2

2007-10-10 Thread Peter Dalgaard
elyakhlifi mustapha wrote: Hello, I want to use the quantile function so I read the doc but I don't understand with this qchisq(seq(0.05,0.95,by=0.05),df=(length(don)-1)) [1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39 63160.27 63205.65 63250.33 63295.04

Re: [R] average waveform over many cycles

2007-10-10 Thread Jim Lemon
Bill Simpson wrote: I have 400 cycles of a noisy waveform. I would like to find the average (over the 400 cycles) of one cycle. Please tell me to do it in R. Any suggestions welcome! Hi Bill, I recently had to do something like this for an approach to target curve. The steps were: 1) Create

Re: [R] chi2

2007-10-10 Thread Alberto Monteiro
Elyakhlifi Mustapha wrote: I want to use the quantile function so I read the doc but I don't understand with this qchisq(seq(0.05,0.95,by=0.05),df=(length(don)-1)) [1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39 63160.27 63205.65 63250.33 63295.04 63340.48 63387.48

Re: [R] Problem with RCMD CHECK (or BUILD)

2007-10-10 Thread Duncan Murdoch
On 10/10/2007 6:41 AM, Prof Brian Ripley wrote: We do recommend Rcmd build mpkg to build a source package, followed by Rcmd INSTALL --build mypkg_ver.tar.gz to install it and zip up a version for distribution. It is 'check' and 'build', and I believe R should refuse to use CHECK or

Re: [R] Data manipulation question

2007-10-10 Thread Gabor Grothendieck
Try this: transform(d, z = y[match(x, id)]) On 10/10/07, Julien Barnier [EMAIL PROTECTED] wrote: Hi all, Suppose I have the following data.frame, with an id column and two variables columns : idX Y 0001 NA 21 0002 NA 13 0003 000145 0004

Re: [R] average waveform over many cycles

2007-10-10 Thread Bill Simpson
Thanks Jim for the help. I forgot to say that one of my main snags is figuring how how to chop up the one long (44100 samples) vector into pieces (400 of them). This is my C-inspired way of thinking but there must be a better way in R. cyclelength=44100/400 for i= 1 to 400 for j= 1 to

Re: [R] save lm output into vectors

2007-10-10 Thread jim holtman
It really depends on what you want to do with the values. If you are computing these in a loop, then I would suggest that you store the output of 'summary' in a list and you can then extract the values later. Can you provide an idea of what you want to do with them and how you are computing

Re: [R] chi2

2007-10-10 Thread Ted Harding
On 10-Oct-07 10:59:43, elyakhlifi mustapha wrote: Hello, I want to use the quantile function so I read the doc but I don't understand with this qchisq(seq(0.05,0.95,by=0.05),df=(length(don)-1)) [1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39 63160.27 63205.65 63250.33

Re: [R] save lm output into vectors

2007-10-10 Thread Henrique Dallazuanna
Hi, mods - lapply(lapply(df[,which(sapply(df, is.factor))], function(reg)lm(df$value~reg)), summary) res - lapply(mods, [, c(4,10)) And for each model adjusted: 1-pf(res[[2]][[2]][1], res[[2]][[2]][2], res[[2]][[2]][3]) 1-pf(res[[1]][[2]][1], res[[1]][[2]][2], res[[1]][[2]][3]) On

Re: [R] save lm output into vectors

2007-10-10 Thread Chuck Cleland
Henrique Dallazuanna wrote: Hi, mods - lapply(lapply(df[,which(sapply(df, is.factor))], function(reg)lm(df$value~reg)), summary) res - lapply(mods, [, c(4,10)) And for each model adjusted: 1-pf(res[[2]][[2]][1], res[[2]][[2]][2], res[[2]][[2]][3]) 1-pf(res[[1]][[2]][1],

Re: [R] Odp: Data manipulation question

2007-10-10 Thread Julien Barnier
Hi Petr, d$z-NA d$z[d$x %in% d$id] - d$y[d$id %in% d$x] works in this particular case but it means you do not have multiple same ids and X Thanks for the idea. But the problem is that I can have multiple ids... In fact in the meantime I found a solution by using row names : R d id

Re: [R] average waveform over many cycles

2007-10-10 Thread jim holtman
try: y - matrix(x, ncol=400, byrow=TRUE) On 10/10/07, Bill Simpson [EMAIL PROTECTED] wrote: Thanks Jim for the help. I forgot to say that one of my main snags is figuring how how to chop up the one long (44100 samples) vector into pieces (400 of them). This is my C-inspired way of thinking

[R] Warning message when using reldist package

2007-10-10 Thread Jing Shen
Dear R users, I'm using the reldist add-on package to calculate relative distribution in R as part of my research project. The subject is a general mental health score ranging from 0 to 12 (integer values only) with 0 indicating no mental health problem and positive values meaning some or

Re: [R] subsetting a data.frame

2007-10-10 Thread jim holtman
Is this what you want? x - read.table(textConnection(Score Name + 88 19_0070 + 88 19_0070 + 87 19_0070 + 79 002127_0658 + 79 002127_0658 + 77 002127_0658), header=TRUE) # return best scores best - by(x, x$Name,

Re: [R] window (x,y) co-ordinates of datapoints

2007-10-10 Thread hadley wickham
On 10/10/07, Jim Lemon [EMAIL PROTECTED] wrote: Alberto Monteiro wrote: Prof Brian Ripley wrote: Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. Is there any hope that, instead of fin, din, pin, etc someday we will have fmm,

Re: [R] Using expression for Italics and object evaluation in plot title

2007-10-10 Thread Gabor Grothendieck
Try bquote as in: http://tolstoy.newcastle.edu.au/R/e2/help/07/09/26353.html On 10/10/07, Daniel Brewer [EMAIL PROTECTED] wrote: Hi, I am trying to get a title on a plot that contains both some formatting and prints the value of an object. What I have been using to get the italics is:

Re: [R] window (x,y) co-ordinates of datapoints

2007-10-10 Thread Alberto Monteiro
Hadley Wickham wrote: Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? Why worry about that, Alberto, when you can use my ammazing function: mm2in(x) return(x/25.4) thus: par(pin=mm2in(126)) But be sure to use it consistently!

Re: [R] Using expression for Italics and object evaluation in plot title

2007-10-10 Thread Daniel Brewer
Thanks. That works great if I do this: title(sub=bquote(italic(p)-value == .(p.val))) But if I add text to the beginning e.g. title(sub=bquote(Log rank test italic(p)-value == .(p.val))) I get an error message saying, Error: syntax error, unexpected SYMBOL, expecting ',' in title(sub=bquote(Log

Re: [R] Odp: Data manipulation question

2007-10-10 Thread Petr PIKAL
Petr PIKAL/CTCAP napsal dne 10.10.2007 15:03:28: [EMAIL PROTECTED] napsal dne 10.10.2007 13:55:32: Hi Petr, d$z-NA d$z[d$x %in% d$id] - d$y[d$id %in% d$x] works in this particular case but it means you do not have multiple same ids and X Thanks for the idea. But the

[R] Setting qplot default options

2007-10-10 Thread Christoph Krammer
Hello, is there a possibility to set default options to qplot? I need to draw a lot of graphs and would like to have all of them as point plot but with a greater size and a fixed color for all dots. Thanks for help. Christoph __ R-help@r-project.org

[R] How to catch a R error in R code

2007-10-10 Thread HU,ZHENGJUN
Hi All, I entered a R statement, e.g. 1:20 = x or log(a) on an HTML form and passed it to a R-CGI script. Obviously, neither of both is a correct R statement or expression. However, my R-CGI script could not return and report the error message to the Web site even though it received the

[R] how to generate and evaluate a design using Algdesign

2007-10-10 Thread sun
Hi, I have some problems when using AlgDesign-optFederov() generating designs. I have 6 variables, all factors. 3^2 and 4^4, I want to have a design that can take care of main effects and two interactions within 2 pair of variables v3-v4 and v5-v6, the following is the code

Re: [R] Visualize cox proportional hazards

2007-10-10 Thread Christos Hatzis
Armin, RSiteSearch(forest plot meta analysis) will point you to the metaplot function in the rmeta package. There is also a forestplot function in the same package that offers more flexibility. These plots are useful in meta analysis in general (e.g. showing odds ratios from different studies).

Re: [R] Using expression for Italics and object evaluation in plot title

2007-10-10 Thread Gabor Grothendieck
The expression in plotmath must be valid R syntax. plot(1) p.val - .1 title(sub=bquote(Log ~ rank ~ test ~ (italic(p)-value == .(p.val On 10/10/07, Daniel Brewer [EMAIL PROTECTED] wrote: Thanks. That works great if I do this: title(sub=bquote(italic(p)-value == .(p.val))) But if I add

Re: [R] Setting qplot default options

2007-10-10 Thread hadley wickham
On 10/10/07, Christoph Krammer [EMAIL PROTECTED] wrote: Hello, is there a possibility to set default options to qplot? I need to draw a lot of graphs and would like to have all of them as point plot but with a greater size and a fixed color for all dots. Sure. It's a bit of hack, but:

Re: [R] How to catch a R error in R code

2007-10-10 Thread jim holtman
You need to follow the posting guide and provide commented, minimal, self-contained, reproducible code. I can only guess at what your code looks like, but the following catches the error: z - try(eval(parse(text=1:20 - x))) Error in eval(expr, envir, enclos) : object x not found str(z) Class

[R] disperse variable

2007-10-10 Thread Stefo Ratino
Hello all, I read the following variable x x 1 1_A1_ML1_a.DLL 2 11_B1_ML2_a.DLL 3 4_A1_ML3_a.DLL 4 55_C1_ML4_a.DLL 5 14_C1_ML5_a.DLL I would like to disperse it in three variable such as x1 [1] 1 11 4 55 14 x2 [1] A1 B1 A1 C1 C1 x3 [1] ML1 ML2 ML3 ML4 ML5

Re: [R] How to catch a R error in R code

2007-10-10 Thread Kuhn, Max
Howard, though it received the statement. I tried to use some R built-in functions of try, tryCatch, eval, expression, as.expression, parse, deparse, etc. None of them worked. How did they not work? What did you attempt? Did you use silent = TRUE in try? Please be more specific about the

[R] simulated data using empirical distribution

2007-10-10 Thread Tom Sgouros
Hello all: I'm sure this is a trivial request, but I'm still a beginner at this, and haven't been able to find it. I need to create simulated data based on some empirical distributions of a single variable. I've found R functions to help me simulate data based on analytical distributions, or

[R] detrending a time series

2007-10-10 Thread Christoph Scherber
Dear R users, I am trying to ´detect´ the trend in an artificial time series created by the simple function x=seq(pi,10*pi,0.1) my.ts=0.1*x+sin(x) my.ts=ts(my.ts,start=1800) plot(my.ts) I have tried stl(my.ts), but because I don´t have ´replications´ at every time point, this somehow doesn´t

[R] download.file not working

2007-10-10 Thread Gustaf Rydevik
Hi all, I'm trying to download a file from the net, and the download.file command leaves it corrupted, i.e excel cannot open it. It seems as if it's going ok, however. Does anyone have an idea of what's going on? regards, Gustaf Rydevik

[R] Deleting for() loop in function

2007-10-10 Thread Dong-hyun Oh
Dear UseRs, I wrote following function in order to solve Data Envelopment Analysis. Reason for posting is that the function is slow when nrow(dat) is large. I wonder if other functions could substitute the for() loop in the code, such as mapply(). Can anybody help to rewrite the dea() function

Re: [R] as.dist with diagonal unequal zero

2007-10-10 Thread Gavin Simpson
On Wed, 2007-10-10 at 16:42 +0200, Birgit Lemcke wrote: Hello and sorry that I still haven´t found a solution for my problem. I need to extract the lower and upper triangle from a square matrix including the diagonal. This diagonal is not zero in that special case. How can a site have a

Re: [R] subsetting a data.frame

2007-10-10 Thread Peter Dalgaard
jim holtman wrote: Is this what you want? x - read.table(textConnection(Score Name + 88 19_0070 + 88 19_0070 + 87 19_0070 + 79 002127_0658 + 79 002127_0658 + 77 002127_0658), header=TRUE) # return

Re: [R] How do I obtain the design matrix of an lm()?

2007-10-10 Thread Bert Gunter
If all you're doing is fitting different responses to the same X data, then you don't need model.matrix. See ?update, ?update.formula. Bert Gunter Genentech Nonclinical Statistic -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ajay Shah Sent: Tuesday,

Re: [R] as.dist with diagonal unequal zero

2007-10-10 Thread Gustaf Rydevik
On 10/10/07, Birgit Lemcke [EMAIL PROTECTED] wrote: Hello and sorry that I still haven´t found a solution for my problem. I need to extract the lower and upper triangle from a square matrix including the diagonal. This diagonal is not zero in that special case. I tried with as.dist

Re: [R] download.file used incorrectly (was not working)

2007-10-10 Thread Prof Brian Ripley
On Wed, 10 Oct 2007, Gustaf Rydevik wrote: Hi all, I'm trying to download a file from the net, and the download.file command leaves it corrupted, i.e excel cannot open it. It seems as if it's going ok, however. Does anyone have an idea of what's going on? That is a binary file. You needed

Re: [R] as.dist with diagonal unequal zero

2007-10-10 Thread Birgit Lemcke
This are distances but between male and female plants of the same species. species A B C D E -- male A B C D | female I would like to do a Manteltest. Birgit Am 10.10.2007 um 16:59 schrieb Gustaf Rydevik:

Re: [R] simulated data using empirical distribution

2007-10-10 Thread Dieter Menne
Tom Sgouros tomfool at as220.org writes: What I have is twelve bins of data, and the population in each bin. The top bin is open-ended, and the whole distribution is more or less poisson-ish. I can think of a couple of ways to fake this ok, but is there a real R way to do it?

[R] Thank you, and your suggestion works

2007-10-10 Thread HU,ZHENGJUN
Hi Jim, What you told me works well. I have tried using 'eval(parse(text=1:20 = x))' as well as 'try(parse(text=1:20 = x))' before but not using eval anfd try functions together. I just added try function following your suggestion, e.g. 'try(eval(parse(text=1:20 = x)))'and then it worked

[R] (no subject)

2007-10-10 Thread Joao Santos
Hello, I problem is in the format of the date, my time series is like this: 2006070100 1244 6162 2006070101 1221 6060 2006070102 1214 6060 2006070103 1194 5959 2006070104 1182 5858 2006070105 1178

Re: [R] transparent colors

2007-10-10 Thread Uwe Ligges
See ?rgb and its alpha argument, for example. Uwe Ligges Markus Loecher wrote: Dear R graphics experts, Do you know of any way of plotting semi-transparent points in R ? I face this problem any time I want to e.g. plot thousands of points that belong to two or three classes which I color

Re: [R] as.dist with diagonal unequal zero

2007-10-10 Thread Sarah Goslee
You may be better off using a complete distance matrix and a model matrix describing plant sex, as explained in Legendre and Fortin 1989 and elsewhere. Otherwise you will have to write your own Mantel code - all the examples I know of (vegan and ecodist, primarily) assume that diagonals are zero

Re: [R] transparent colors

2007-10-10 Thread Prof Brian Ripley
See ?rgb and the article by Paul Murrell in R-news 2004-2. (The details of where it is supported have changed in the last three years, though.) On Wed, 10 Oct 2007, Markus Loecher wrote: Dear R graphics experts, Do you know of any way of plotting semi-transparent points in R ? I face this

Re: [R] Help with gamm errors

2007-10-10 Thread Simon Wood
Rob, Thanks for sending the example... m1=gamm(present~s(week,bs=cc)+s(week,bs=cc,by=y1),random=list(garden=~1 ) , correlation=corAR1(form=~1|garden),family=binomial,data=count.data2) (ie removing the week term). This model proceeds - to a point... Maximum number of PQL iterations: 20

Re: [R] transparent colors

2007-10-10 Thread Greg Snow
It can be as simple as: plot( rnorm(1000), rnorm(1000), col=#ff22, pch=16,cex=3) Where the color is #RRGGBBAA and the AA portion is the opacity/trasparency. Of course this only works if you are using a graphics device that supports transparency. The windows device under R 2.6.0 does (but

[R] caTools package

2007-10-10 Thread Judith Flores
Hi, I tried to install the caTools package manually from the main R Project website and I get the following error message when typing library('caTools') Error in library(caTools) : 'caTools' is not a valid package -- installed 2.0.0? What am I doing wrong? Also, why is this package

Re: [R] Rooting trees using ape

2007-10-10 Thread Ben Bolker
Chris Jones-35 wrote: Hi all, I seem to be having a difficult time using the 'ape' package in R when it comes to rooting trees. Here's a short screenshot: [snip] Can you post your dataset, or a subset of it that replicates the problem, somewhere? (On the list if short,

Re: [R] Deleting for() loop in function

2007-10-10 Thread jim holtman
One of the things that you should do is to use Rprof to see where time is being spent. I would guess that is the not the 'for' loop, but instead what is being done inside it. My guess it that most of the time is being spent in the number of times that 'lp' is being called. So the real problem

[R] about regression tree label

2007-10-10 Thread Aimin Yan
Hello, I have a question about splitting label in regression tree. for example, by using the following command plot(m.regression.tree.pr,uniform=T,margin=0.05,branch=0.7,compress=F) text(m.regression.tree.pr,pretty=0) I get a tree with one label in some splitting node like this bcu0.004969 Now

Re: [R] Visualize cox proportional hazards

2007-10-10 Thread Sandrine-et-Francois
Here you go http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=114 Also have a look @ http://www.bmj.com/cgi/reprint/322/7300/1479.pdf HTH Francois - Original Message - From: Armin Goralczyk [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: R-help@r-project.org Sent: Wednesday,

Re: [R] (no subject)

2007-10-10 Thread Jim Porzak
Joao, I can't reproduce your results. Try: str(A) When I read in the data frame A, I see str(A) 'data.frame':10 obs. of 4 variables: $ date: int 2006070100 2006070101 2006070102 2006070103 2006070104 2006070105 2006070106 2006070107 2006070108 2006070109 $ my1 : int 1244 1221 1214

[R] simple function with if - lapply to dataframe

2007-10-10 Thread Georg Ehret
Dear R, I am writing a simple function to extract the sign of values and apply it to a data frame (see below). Whatever I do I get error-messages... What is wrong? Thanking you in advance, Cheers, Georg. *** Georg Ehret Institute of Genetic Medicine Johns Hopkins University

Re: [R] Clustering techniques using R

2007-10-10 Thread ngottlieb
Maura: I looked at the scatter plots you sent. A few thoughts: 1- Patient 3 data has a lot of missing data. This will make doing a good grouping against your cases an issue. Missing data is so common and much work has been done in this area. One can do the trivial approach, forward fill

Re: [R] simple function with if - lapply to dataframe

2007-10-10 Thread James W. MacDonald
Hi Georg, Georg Ehret wrote: Dear R, I am writing a simple function to extract the sign of values and apply it to a data frame (see below). Whatever I do I get error-messages... What is wrong? The main problem here is you are ignoring existing functions that will do the job much better.

Re: [R] Deleting for() loop in function

2007-10-10 Thread Duncan Murdoch
On 10/10/2007 2:03 PM, Alberto Monteiro wrote: Jim Holtman wrote: One of the things that you should do is to use Rprof to see where time is being spent. Rprof is great! I didn't know such functionality existed. But I am a very destructive user; I think I found a way to break Rprof: if I

Re: [R] Deleting the White Space in an R graph

2007-10-10 Thread Bert Gunter
As usual, explicit code would help (see the posting guide)-- what kinds of graphs (R has at least three separate systems)? What graphs/maps in particular?. But presumably a careful reading of ?par with particular attention to the mar parameter (possibly also xlim/ylim) might solve your problem .

Re: [R] Deleting the White Space in an R graph

2007-10-10 Thread Greg Snow
The squishplot function in the TeachingDemos package will move the axes and other annotation closer to the plot so there is less whitespace within the plot region (there will still be whitespace in the margin areas beyond the axes and labels). Is this what you want? To completely eliminate all

[R] weird (?) resid(.) from 2-level lme()

2007-10-10 Thread Irene Mantzouni
Hi all! I am trying to fit a 2-level hierarchical lme(). I can extract ranef() and coef() without problems for levels=1:2. However, when it comes to resid() at level=2, the resulting list has some unnamed entries (label=NA). I checked with my data (NAs have been omitted) and I found out that

Re: [R] psi using .C with R

2007-10-10 Thread Katharine Mullen
in case you are not aware: the function psi is available without a port; see help(digamma). On Wed, 10 Oct 2007, Bernardo Lagos Alvarez wrote: Hi All, Anybody know as run the function psi on http://www.alglib.net/translator/dl/specialfunctions.psi.csharp.zip or

Re: [R] average waveform over many cycles

2007-10-10 Thread Moshe Olshansky
Hi Bill, You get cyclelemgth = 110. If this is true, i.e if every 110 points of data represent an entire cycle then everything is all right, but are you sure this is true? Think what happens if the true cycle length was 110.5 data points. Regards, Moshe. --- Bill Simpson [EMAIL PROTECTED]

Re: [R] 2 Sample Confidence Interval - Formatting Data?

2007-10-10 Thread Moshe Olshansky
Hello Wayne, Welch Test (as suggested by M.S.) can be a good choice, but since your sample is very small you must ask yourself what can you assume about the two samples (i.e. do they come from more or less normal distributions, etc.). Regards, Moshe. --- Wayne Aldo Gavioli [EMAIL PROTECTED]

Re: [R] Rooting trees using ape

2007-10-10 Thread Simon Blomberg
Please supply enough information to allow us to reproduce the error. Also, nirK.tree is a different object to nirk.tree, which might be confusing things. Simon. On Wed, 2007-10-10 at 15:07 +0200, Chris Jones wrote: Hi all, I seem to be having a difficult time using the 'ape' package in R

[R] Rearranging dataset

2007-10-10 Thread Megh Dal
Hi all, I have a datasei like this : ID Date Price aa 01/01/07 12 aa01/02/07 13 bb 01/01/0723 bb01/02/0712 Now I want to write them in following format : ID Date Price ID Date

Re: [R] Rearranging dataset

2007-10-10 Thread Megh Dal
I want to create a data-frame. any idea? Moshe Olshansky [EMAIL PROTECTED] wrote: What do you mean by write - write to file, create a data.frame? --- Megh Dal wrote: Hi all, I have a datasei like this : ID Date Price aa 01/01/07 12 aa 01/02/07 13 bb 01/01/07 23 bb 01/02/07 12 Now