[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 1.9

Re: [R] global object in user defined function

2007-10-10 Thread Katharine Mullen
If I understand your question, then you should just study some examples/other people's code that initialize new objects as the return values of functions. There are two small examples below. On the other hand, if you really need a _global_ object, see help(assign). ## Example 1: last line is ret

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 gam

[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 app

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 = star

[R] Problem with RCMD CHECK (or BUILD)

2007-10-10 Thread Ollivier TARAMASCO
Dear all, I have a problem with R CMD CHECK (R 2.6.0 on Windows XP) Even if I use R CMD CHECK on the windlgs library I get: * using log directory 'C:/PROGRA~1/R/RProgram/src/library/windlgs.Rcheck' * using ARGUMENT ' ' __ignored__ R version 2.6.0 (2007-10-03) * checking for file 'windl

[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 "chec

[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 PLEA

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: 8<-

Re: [R] please help me

2007-10-10 Thread Dieter Menne
azadeh sadeghian 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 u ) but I

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. > > http://cged.genes.nig.ac

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 param

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

2007-10-10 Thread Uwe Ligges
Ollivier TARAMASCO wrote: > Dear all, > > > > I have a problem with R CMD CHECK (R 2.6.0 on Windows XP) > > Even if I use R CMD CHECK on the windlgs library I get: So how are you calling it precisely? Have you installed the recent tools for building R-2.6.0 and *packages*? Uwe Ligges >

[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 V&R'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 th

[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 abo

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) dat<-gen.factorial(levels,center=FALSE,varNames=names(level

[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

[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 Y

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

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 estimati

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

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 estim

[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, o

[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 http://tolstoy.newcastle.edu.au/R/devel/06/0

[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 https://stat.ethz

[R] Odp: Data manipulation question

2007-10-10 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 10.10.2007 12:10:29: > 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

[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 6

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 match

[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

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 63

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 632

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) C

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 63

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 us

Re: [R] chi2

2007-10-10 Thread Alberto Monteiro
Oops... Check... http://en.wikipedia.org/wiki/Chi-square_distribution The Chi-square distribution for _any_ df has mean = df and variance = 2df, so for large df, it's approximately a normal distribution with mean = df and sd = sqrt(2 df) [and not sqrt(df) as I wrote in a previous message that, pr

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 >

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 cycleleng

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 them.

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 632

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 09/10/2

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], res[

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

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

[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 sev

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, f

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, e

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] Odp: Data manipulation question

2007-10-10 Thread Petr PIKAL
[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 problem is that I can have multiple > ids... >

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 consis

[R] Rooting trees using ape

2007-10-10 Thread Chris Jones
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: > nirK.tree Phylogenetic tree with 23 tips and 21 internal nodes. Tip labels: Burkholder, Burkholde3, Burkholde1, Burkholde4, Burkholde5, Ralstonia2

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 > > > > Tha

[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 st

[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

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, bu

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)

[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" "ML

Re: [R] R dynamic memory management

2007-10-10 Thread Maura E Monville
I forgot to attach my script. I work under pressure and make a lot of these mistakes. Sorry. I have attached it right now. I'm lso pasting the messages appearing on R GUI in the following. I see the average becomes NA which makes me think that for some reason R interpreter is reading out of the loa

[R] as.dist with diagonal unequal zero

2007-10-10 Thread Birgit Lemcke
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 w<-as.dist(w, diag = TRUE) > w 1 2 3 4 5 1 0 2 2 0 3

Re: [R] simulated data using empirical distribution

2007-10-10 Thread Daniel Lakeland
On Wed, 2007-10-10 at 10:13 -0400, Tom Sgouros wrote: > 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

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 t

[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 to

[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 >download.file(url="http://www.who.int/entity/whosis/

[R] Great candidates - great value!

2007-10-10 Thread London4Jobs
This is a text part of the message. It is shown for the users of old-style e-mail clients __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email

[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)

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, O

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 n

Re: [R] download.file not working

2007-10-10 Thread Henrik Bengtsson
On 10/10/07, Gustaf Rydevik <[EMAIL PROTECTED]> 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? > > regards, > > Gu

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 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? > hist(rpois(

[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 w

[R] gee, error=104

2007-10-10 Thread Michel Chavance
I am using gee to fit a log-linear marginal model to grouped data. I get sensible results unfortunately followed by this warning Warning message: Note: Cgee had an error (code= 104 ). Results suspect. in: gee(formula = event ~ exgr + agegr + indiv + offset(loginterval), Does anyone knows what

Re: [R] gee, error=104

2007-10-10 Thread Prof Brian Ripley
On Wed, 10 Oct 2007, Michel Chavance wrote: > I am using gee to fit a log-linear marginal model to grouped data. I > get sensible results unfortunately followed by this warning > > Warning message: > Note: Cgee had an error (code= 104 ). Results suspect. in: > gee(formula = event ~ exgr + agegr +

[R] transparent colors

2007-10-10 Thread Markus Loecher
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 code. With the default opaque colors, the plotting order matters and basically the po

[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 co

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 w

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 itera

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 (

[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 sho

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 mig

Re: [R] How to create something between a script and a package

2007-10-10 Thread Douglas Bates
On 10/8/07, Sergio Correia <[EMAIL PROTECTED]> wrote: > (Before starting: I'm a total R noob so please bear with me in case of > any error or faux pas). > > Hi, > > For a small project, I'm writing a few simple R functions and calling > them from python (using RPy). I'm sharing the code with a coup

Re: [R] caTools package

2007-10-10 Thread Prof Brian Ripley
You haven't told us your OS or R version (as we did ask). But until last night there was not a version of caTools that worked correctly in the current R (>= 2.6.0), so you may need to be patient. On Wed, 10 Oct 2007, Judith Flores wrote: > Hi, > > I tried to install the caTools package manual

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

2007-10-10 Thread Alberto Monteiro
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 do f <- my.slow.function then call f(...)

[R] date format conversion problem

2007-10-10 Thread Ben Bolker
Joao Santos-7 wrote: > > Hello, > > I problem is in the format of the date, my time series is like this: > > [snip] > > When I attempt to format the time like this: > > A <- read.table("file", sep="\t", col.names=c("date", "my1", "my2", > "my3")) > temp <- as.Date(A$date, format="%Y%m%d%H")

[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 bcu<0.004969 Now

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

2007-10-10 Thread jim holtman
There are a couple of outputs from Rprof. One shows time spent in the function (and everything that it calls) and the other in the function itself. What I do is to post process the output from Rprof into a format that is easier to understand. In this case, the Rprof run took 12.2 seconds of whic

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: Sent: Wednesday, October 10, 2007

  1   2   >