Re: [R] How to add a top level title to multiple plots

2009-11-20 Thread Jason Rupert
Cool. I ended up with the following: par(mfrow = c(2, 2)) # Plot 1 plot(rnorm(10),type="l",col="red") title(main = list(paste("Normal"), col="black", cex = 1.0)) # Plot 2 plot(rpois(10, 4),type="l",col="blue") title(main = list(paste("Poison"), col="black", cex = 1.0)) # Plot 3

[R] How to make a cartesian pairlist?

2009-11-20 Thread newbyr
Hi, I'd like to make a pairwise comparison of a data.frame and I'm looking for a function that will take a list of columns or data.frame and corvert it to cartesian pairlist. For example for this data.frame (see below), I'd like to get a list of all possible pairs: > sound cs rs ns 7 5 2

Re: [R] [Rd] Including local dynamic libraries

2009-11-20 Thread Elana Fertig
Thanks all for your time! I think I got it -- you can use dyn.load() in R to load in all the libraries inside R. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.o

[R] (ecological) model sensitivity analysis book

2009-11-20 Thread milton ruser
Dear all, I know that my question may be so general, but I would like to know if is there a good book for model sensitivity analysis (applied to ecology?) that use R? Is there any package dedicated to model sensitivity analysis on R? Cheers milton [[alternative HTML version deleted]] _

[R] Missing data by design

2009-11-20 Thread Timothy Ballard
Hi readers, I'm new to the R package and have a question about handling missing data in R. I have a dataset from a longitudinal study where we are are testing a series of models, some in which lagged variables are used to predict an outcome and others in which concurrent variables are used. Due

Re: [R] "subset" or "condition" as argument to a function

2009-11-20 Thread Santosh
To further explain my case.. am reproducing one of the examples.from one of contributors' guides.. ___ attach(ais) here<- sex=="f" plot(pcBfat[here]~ht[here], xlab = “Height”, ylab = “% Body fat”) panel.smooth(ht[here],pcBfat[here]) detach(ais) __ A condition is in "here",.

Re: [R] How to concatenate a vector of strings to a string?

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 8:03 PM, Peng Yu wrote: paste(c('a','b'),sep='') [1] "a" "b" The above command doesn't concatenate the strings in a single string. I'm wondering what is the correct way to do so. Remember that paste is vectorised. That behavior is desired: > paste('a','b',sep='') [1] "a

Re: [R] How to make a cartesian pairlist from a vector?

2009-11-20 Thread Charles C. Berry
On Fri, 20 Nov 2009, newbyr wrote: Hi, I'm looking for a function that will take a list of columns or data.frame and corvert it to cartesian pairlist. For example for this data.frame (see below), I'd like to get a list of all possible pairs: sound cs rs ns 7 5 2 4 5 4 6 3 1 8 4

[R] How to make a cartesian pairlist from a vector?

2009-11-20 Thread newbyr
Hi, I'm looking for a function that will take a list of columns or data.frame and corvert it to cartesian pairlist. For example for this data.frame (see below), I'd like to get a list of all possible pairs: > sound cs rs ns 7 5 2 4 5 4 6 3 1 8 4 1 6 4 2 6 7 1

[R] "subset" or "condition" as argument to a function

2009-11-20 Thread Santosh
Dear Rxperts! I was wondering if it is possible to write a function which can take in argument of a subset or condition.. Of course, I am aware of the alternate methods like coplot, par.plot, xyplot etc... I am specifically interested in using conditions/subsets with "plot".. A simple fragmented

[R] How to change the label font size?

2009-11-20 Thread Peng Yu
The labels on the axis overlap. Is there a way to change their font size smaller? m=100 n=100 X=replicate(n,rnorm(m)) image(X,axes=F) axis(side=1,at=seq(from=par()$usr[1],to=par()$usr[2],length=(m+1))[1:m],labels=replicate(m, 'A'),las=2) __ R-help@r-pr

Re: [R] How to concatenate a vector of strings to a string?

2009-11-20 Thread jim holtman
?paste Read the help file, esp the collapse parameter. Might help to reread Intro to R. On Fri, Nov 20, 2009 at 8:03 PM, Peng Yu wrote: >> paste(c('a','b'),sep='') > [1] "a" "b" > > The above command doesn't concatenate the strings in a single string. > I'm wondering what is the correct way to

Re: [R] Stacked Bar Plot

2009-11-20 Thread RICHARD M. HEIBERGER
tmp <- cbind(x=c(1,-.2,.3,.4), y=c(.5,.6,-.7,.8)) row.names(tmp) <- letters[1:4] barchart(tmp, horizontal=FALSE, stack=TRUE, auto.key=list( title="pollutant", border=TRUE), xlab="Month", main="Interesting Plot") barcha

[R] How to concatenate a vector of strings to a string?

2009-11-20 Thread Peng Yu
> paste(c('a','b'),sep='') [1] "a" "b" The above command doesn't concatenate the strings in a single string. I'm wondering what is the correct way to do so. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Changing coordenates

2009-11-20 Thread Don MacQueen
See the spTransform function in the rgdal package. -Don At 7:05 PM -0500 11/20/09, Jimmy Martina Vasquez wrote: Hi everybody: Does anyone know how I can change geodesic coordenates into UTM ones? Thanks in advance for your cooperation, Jimmy M. ___

Re: [R] How to do X11 seasonal adjust in R?

2009-11-20 Thread John C Frain
I have used Gretl (http://gretl.sourceforge.net/) to apply X-11 (Actually X12-ARIMA) or TRAMO/SEATS to seasonally adjust various series and then export the results direct from Gretl to R. This appears to work well. Best Regards John 2009/11/20 sdlywjl666 : > Dear All, > How to do X-11 seasonal

Re: [R] boxplot question

2009-11-20 Thread Peter Ehlers
If there's been an answer to this, I've missed it. Here's my take. Antje wrote: Hi there, I was wondering if anybody can explain to me why the boxplot ends up with different results in the following case: I have some integer data as a vector and I compare the stats of boxplot with the same

Re: [R] Stacked Bar Plot

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 6:54 PM, Gary wrote: Hi R Folks, I need to plot a stacked bar plot with row labels as A,B,C,... and each bar divided by x,y, Here is the data: x y A 1 .5 B -.2 .6 C .3 -.7 D .4 .8 (for e.g. x,y,... could be air pollutants and A,B,C,... could be months) At the m

[R] Changing coordenates

2009-11-20 Thread Jimmy Martina Vasquez
Hi everybody: Does anyone know how I can change geodesic coordenates into UTM ones? Thanks in advance for your cooperation, Jimmy M. _ Bing brings you maps, menus, and reviews org

[R] Stacked Bar Plot

2009-11-20 Thread Gary
Hi R Folks, I need to plot a stacked bar plot with row labels as A,B,C,... and each bar divided by x,y, Here is the data: x y A 1 .5 B -.2 .6 C .3 -.7 D .4 .8 (for e.g. x,y,... could be air pollutants and A,B,C,... could be months) Issue 1) It has negative values. Issue 2) It contain two c

Re: [R] How to setup the tsp attribute of a dataset

2009-11-20 Thread Gabor Grothendieck
tsp is supposed to be applied to a ts object. If you are not using ts objects then that is your problem. On Fri, Nov 20, 2009 at 6:43 PM, Samik Raychaudhuri wrote: > Looks like there is a difference between when I use frequency(x) vs. when I > use frequency(x.ts). If I try to get the tsp attribut

Re: [R] How to setup the tsp attribute of a dataset

2009-11-20 Thread Samik Raychaudhuri
Looks like there is a difference between when I use frequency(x) vs. when I use frequency(x.ts). If I try to get the tsp attribute of x by using attr(x, "tsp"), it still shows up as NULL. When I looked at the code of frequency() function (in stats), it seems to be looking at attr(x, "tsp"), whi

Re: [R] Help with multiple comparisons on a 2-way repeated measures ANOVA

2009-11-20 Thread Karine Gagnon
Thank you! That's exactly what I was looking for. Very much appreciated! Karine On Fri, Nov 20, 2009 at 5:14 PM, Richard M. Heiberger wrote: > > install.packages("HH") > > library(HH) > > ?MMC > > Go to the bottom of the page and read the maiz example. > Read through the example that shows aovl

Re: [R] How to setup the tsp attribute of a dataset

2009-11-20 Thread Gabor Grothendieck
Not for me. > x <- 1:100 > x.ts <- ts(x, start = 1, frequency = 4) > frequency(x.ts) [1] 4 On Fri, Nov 20, 2009 at 6:21 PM, Samik Raychaudhuri wrote: > Thanks Gabor. Even after doing as you suggested, when I check the frequency > of x, it still shows up as 1. I would have expected it to be 4 no

Re: [R] How to add a top level title to multiple plots

2009-11-20 Thread Peter Ehlers
Jason Rupert wrote: How can I add an overall plot title to these four plots? I would like to have something that says, "Distribution Comparisons": title("Distribution Comparisons", outer = TRUE) But you may have to make room for it with par(oma=...). -Peter Ehlers par(mfrow = c(2, 2))

Re: [R] How to setup the tsp attribute of a dataset

2009-11-20 Thread Samik Raychaudhuri
Thanks Gabor. Even after doing as you suggested, when I check the frequency of x, it still shows up as 1. I would have expected it to be 4 now. > x.ts <- ts(x, start=1, frequency=4) > frequency(x) [1] 1 On 11/20/2009 4:05 PM, Gabor Grothendieck wrote: The first two components of the tsp vector

Re: [R] can R scripts detect signals sent by the task scheduler ?

2009-11-20 Thread Barry Rowlingson
On Fri, Nov 20, 2009 at 11:01 PM, wrote: > I have just updated R version to 2.10 for Windows. > I cannot find package "fork" which seems to include  the exception handling > functions. > The list that pops up when I select Install Package does not contain any > fork package (even spelt > with cap

[R] How to put x-axis labels vertically?

2009-11-20 Thread Peng Yu
image(array,axes=F) axis(side=1,at=seq(from=par()$usr[1],to=par()$usr[2],length=size),labels=some_labels) I have the above code to plot a heatmap. But I want to make the labels on the x-axis vertical. Could somebody let me know how to do it? __ R-help@r

Re: [R] How do I specify a partially completed survival analysis model

2009-11-20 Thread Terry Therneau
--- begin inclusion -- After I simulate Time and Censor data vectors denoting the censoring time and status respectively, I can call the following function to fit the data into the Cox model (a is a data.frame containing 4 columns X1, X2, Time and Censor): b = coxph (Surv (Time, Censor) ~ X1 + X2,

Re: [R] How to add a top level title to multiple plots

2009-11-20 Thread Phil Spector
Jason - I've found the mult.fig.p function in the cwhmisc package to be very handy for this sort of thing. - Phil Spector Statistical Computing Facility Department of Stati

[R] R: can R scripts detect signals sent by the task scheduler ?

2009-11-20 Thread mauede
I have just updated R version to 2.10 for Windows. I cannot find package "fork" which seems to include the exception handling functions. The list that pops up when I select Install Package does not contain any fork package (even spelt with capital letters). Where am I supposed to get it from ?

[R] How to add a top level title to multiple plots

2009-11-20 Thread Jason Rupert
How can I add an overall plot title to these four plots? I would like to have something that says, "Distribution Comparisons": par(mfrow = c(2, 2)) # Plot 1 plot(rnorm(10),type="l",col="red") title(main = list(paste("Normal"),   col="black", cex = 1.0)) # Plot 2 plot(r

Re: [R] How to setup the tsp attribute of a dataset

2009-11-20 Thread Gabor Grothendieck
The first two components of the tsp vector are in time units as mentioned in ?tsp . Thus you would want: > x <- 1:100 > tsp(x) <- c(1, 25.75, 4) but normally you don't have to set it explicitly in the first place. Just use ts: > x <- 1:100 > x.ts <- ts(x, start = 1, frequency = 4) > tsp(x.ts) [1

Re: [R] help me avoid nested for() loops!

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 5:05 PM, Andrew Barr wrote: Hi R folks, I have a massive array (object name "points") in the following form [,1] [,2] [1,] 1369 22 [2,] 1370 22 [3,] 1368 23 [4,] 1369 23 [5,] 1370 23 [6,] 1371 23 (10080 rows truncated) mtx <- matrix(scan(textConnectio

Re: [R] help me avoid nested for() loops!

2009-11-20 Thread Charles C. Berry
On Fri, 20 Nov 2009, Andrew Barr wrote: Hi R folks, I have a massive array (object name "points") in the following form [,1] [,2] [1,] 1369 22 [2,] 1370 22 [3,] 1368 23 [4,] 1369 23 [5,] 1370 23 [6,] 1371 23 (10080 rows truncated) These represent pixel coordinates of inter

Re: [R] help me avoid nested for() loops!

2009-11-20 Thread Dylan Beaudette
?dist On Friday 20 November 2009, Andrew Barr wrote: > Hi R folks, > > I have a massive array (object name "points") in the following form > > [,1] [,2] > [1,] 1369 22 > [2,] 1370 22 > [3,] 1368 23 > [4,] 1369 23 > [5,] 1370 23 > [6,] 1371 23 > (10080 rows truncated) > > Thes

[R] How to setup the tsp attribute of a dataset

2009-11-20 Thread Samik Raychaudhuri
Hello, I am wondering how I should set up the tsp attribute (available through attr(x, "tsp")) of a dataset x? Let's assume that x has 100 points, and I want to set the frequency to 4. I tried: > attr(x,"tsp")<-c(1,100,4) Error in attr(x, "tsp") <- c(1, 100, 4) : invalid time series parameters

Re: [R] Help with multiple comparisons on a 2-way repeated measures ANOVA

2009-11-20 Thread Richard M. Heiberger
install.packages("HH") library(HH) ?MMC Go to the bottom of the page and read the maiz example. Read through the example that shows aovlist objects don't work and how to construct the equivalent aov object. __ R-help@r-project.org mailing list https

[R] help me avoid nested for() loops!

2009-11-20 Thread Andrew Barr
Hi R folks, I have a massive array (object name "points") in the following form [,1] [,2] [1,] 1369 22 [2,] 1370 22 [3,] 1368 23 [4,] 1369 23 [5,] 1370 23 [6,] 1371 23 (10080 rows truncated) These represent pixel coordinates of interest in a jpeg image. I need to find the d

[R] Help with multiple comparisons on a 2-way repeated measures ANOVA

2009-11-20 Thread Karine Gagnon
Hi everyone, I'm trying to do a 2-way repeated measures ANOVA with data that looks like this: subject block rep day light response 1 1 1oneL1 5.5 2 1 2oneL1 4.5 3 1 1oneL2 4 4 1 2one

Re: [R] How to: highlight R syntax on webpages ?

2009-11-20 Thread Thomas S. Dye
Hi Erik, Interesting blog. I was pleased to see the reference to org-babel, a language-agnostic alternative to Sweave. Org-babel is a software masterpiece that anyone using emacs, LaTeX and R should know about, especially if they also use python, ruby, clojure, etc. All the best, Tom O

Re: [R] R 2.10 'memory leak'? on OS X

2009-11-20 Thread Stropharia
Thanks a lot Duncan and David, the remedy was to delete the files .Rhistory and .RData via the terminal - with "rm . Rhistory" etc. (By default they are hidden on OS X.) Now R.app opens fine. best, Steve David Winsemius wrote: > > Probably best further discussed on R-SIG-Mac list: > > https

Re: [R] formatting dates in axis labels (ggplot2)

2009-11-20 Thread hadley wickham
Hi Michael, > I'm having trouble figuring out how to format Date variables when used as > axis labels in graphs. > The particular case here is an attempt to re-create Nightingale's coxcomb > graph with ggplot2, > where I'd like the months to be labeled as "Mar 1885", "Apr 1885", using a > date for

Re: [R] nlmeODE

2009-11-20 Thread Leonid Gibiansky
Please, ignore this question (see below): I found the way how to do it Thanks Leonid -- Leonid Gibiansky, Ph.D. President, QuantPharm LLC web:www.quantpharm.com e-mail: LGibiansky at quantpharm.com tel:(301) 767 5566 Leonid Gibiansky wrote: Dear All

Re: [R] Performance of 'by' and 'ddply' on a large data frame

2009-11-20 Thread Tahir Butt
A faster solution using tapply was sent to me via email: testtapply = function(p){ df = randomdf(p) system.time({res = tapply(df$x2,df$x1,min); res = as.Date(res,origin=as.Date('1970-01-01')); df$mindate = res[as.character(df$x1)]}) } Thanks Phil! Tahir On

Re: [R] How to: highlight R syntax on webpages ?

2009-11-20 Thread Erik Iverson
Hello, I wrote a Wordpress blog entry about not only highlighting R syntax, but embedding R commands within an entry and using Sweave to produce the R output, all within Emacs. The output of the process is ready to paste Wordpress HTML, and a few other R blogs have started using it to generat

Re: [R] How to use results of distribution fitting for further processing?

2009-11-20 Thread Peter Ehlers
Quite right, David. I forgot to indicate that MASS needs of course to be loaded. It's such a useful package that I usually have it loaded. Raymond: When you ask for help with a function in an add-on package you should indicate that package in your query. -Peter Ehlers David Winsemius wrote:

[R] nlmeODE

2009-11-20 Thread Leonid Gibiansky
Dear All, One more nlmeODE question: I have a differential equation where one of the parameters depends on time. Values of this parameter at fixed time points are known but need to be interpolated between these known points. Can it be implemented in nlmeODE solver? Thanks Leonid --

Re: [R] How to: highlight R syntax on webpages ?

2009-11-20 Thread Romain Francois
Hi, I am about to release the "highlight" package which just does that. You would basically do : > highlight( some_file, output = some_other_file_or_connection, + renderer = renderer_html() ) If you are in a rush you can grab it from r-forge: http://r-forge.r-project.org/projects/highli

Re: [R] read a file into a matrix

2009-11-20 Thread jim holtman
What is wrong with the "extra step"? Is it taking too much time (you did not specify that), is it taking too much memory? How many times are you going to be doing it? If not many, then may be it is OK. You have to quantify what you are asking for. It may take longer to send a message to R-Help

Re: [R] symbol in the plot

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 10:52 AM, gcheer3 wrote: Thank you again, Joh Based on your code seems I solved the problem. new code as follows: cs<-expression(delta[1], delta[2]) plot(sigma, delta1, ylim=range(-0.5, 2), xlab='sigma', ylab='delta', pch=22, type='o') points(sigma, delta2, col='red', a

Re: [R] Problem at adding lines on a graphics with lines() function

2009-11-20 Thread Jorge Ivan Velez
Hi Anna, I guess it happened because the range of datas[1:n, 2] differs from the range of datas[1:n, 3]. A workaround would be either to use the maplot() function as follows or figuring out their ranges and then plug them in as the ylim argument in the plot call. Here is a suggestion using matplo

Re: [R] find data (date) gaps in time series

2009-11-20 Thread Stefan Strohmeier
David and Marc, thank you very much for your quick and professional help. Both approaches are doing what I was looking for. Next time I will try to provide an example that is more clearly. Regards, Stefan University of Bayreuth __ R-help@r-project.o

[R] multivariate type II regressions

2009-11-20 Thread Angelique Dupuch
Dear all, I am looking for a R package or R code dealing with multivariate type II regressions. I know the "lmodel2" and "smatr" packages, but they just allow to perform bivariate type II regressions. Ideally, I would use the method described by McArdle (1988) called "standard minor axis" regres

[R] How can I remove one of variables which both variables have correlation coefficient more than 0.95 randomly?

2009-11-20 Thread bbslover
http://old.nabble.com/file/p26443595/Edragonr.txt Edragonr.txt HI all, I have a 72*495 matrix, and the first column is the response, and the remaining are independences. Final I want to select some independence to fit y, but there are so many independences, the fit result is not meaning, so

Re: [R] symbol in the plot

2009-11-20 Thread gcheer3
Thank you, David. thanks for letting me know how to use expression in legend. It works too. gcheer3 wrote: > > a graph question. Thanks a lot in advance. > > I made two scatterplots on one graph (sigma vs. delta1, sigma vs. delta2) > (20 observations of delta1, delta2 and corresponding sigma)

Re: [R] symbol in the plot

2009-11-20 Thread gcheer3
Thank you again, Joh Based on your code seems I solved the problem. new code as follows: cs<-expression(delta[1], delta[2]) plot(sigma, delta1, ylim=range(-0.5, 2), xlab='sigma', ylab='delta', pch=22, type='o') points(sigma, delta2, col='red', axes=FALSE, type='o') legend("topleft", cs,pch

Re: [R] Problem at adding lines on a graphics with lines() function

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 1:56 PM, anna_l wrote: Hello, I am trying to plot a graphic with many lines with the following command: plot(datas[1:n,1],datas[1:n,2],type="l",main="SP500 Prices and Moving Averages",xlab="Date",ylab="Prices",col="black") lines(datas[1:n,1],datas[1:n,3],type="l",col="g

Re: [R] How to use results of distribution fitting for further processing?

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 1:47 PM, Peter Ehlers wrote: Raymond Wong wrote: This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated. I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing. H

[R] Problem at adding lines on a graphics with lines() function

2009-11-20 Thread anna_l
Hello, I am trying to plot a graphic with many lines with the following command: plot(datas[1:n,1],datas[1:n,2],type="l",main="SP500 Prices and Moving Averages",xlab="Date",ylab="Prices",col="black") lines(datas[1:n,1],datas[1:n,3],type="l",col="green",lty="solid") But I just see the first curve

Re: [R] How to concatenate expressions

2009-11-20 Thread Sebastien Bihorel
Thanks a bunch, Baptiste, Your lapply call works like a charm. BTW, it works also if a, b, and c are expressions :D Sebastien baptiste auguie wrote: Hi, You can try this, though I hope to learn of a better way to do it, a = c(quote(alpha),quote(beta),quote(gamma)) b = lapply(1:3, function(

Re: [R] How to use results of distribution fitting for further processing?

2009-11-20 Thread Peter Ehlers
Raymond Wong wrote: This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated. I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing. How do I assign the values of scale and shape to b and

Re: [R] read a file into a matrix

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 1:01 PM, Peng Yu wrote: On Sat, Nov 21, 2009 at 11:55 AM, Steve Lianoglou wrote: read.delim gives me a data.frame. Is there a function that can return the result in a matrix rather than data.frame? m <- as.matrix(read.delim(..)) I knew this approach. But this takes a

Re: [R] How to: highlight R syntax on webpages ?

2009-11-20 Thread Benilton Carvalho
take a look at geshi. b On Nov 20, 2009, at 4:26 PM, Tal Galili wrote: My question if in the Subject, but if to extend: I am specifically curious about WordPress blogs. But any solution will give me a lead. Thanks, Tal -- Contact me: tal.gal...@gm

[R] How to use results of distribution fitting for further processing?

2009-11-20 Thread Raymond Wong
This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated.   I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing.  How do I assign the values of scale and shape to b and a without manually en

Re: [R] read a file into a matrix

2009-11-20 Thread Benilton Carvalho
I can't think of anything that is already built in. But you can always: read.as.matrix <- function(...) as.matrix(read.delim(...)) and now you get one step only ;-) b On Nov 20, 2009, at 4:01 PM, Peng Yu wrote: On Sat, Nov 21, 2009 at 11:55 AM, Steve Lianoglou wrote: read.delim gives me a

[R] How to: highlight R syntax on webpages ?

2009-11-20 Thread Tal Galili
My question if in the Subject, but if to extend: I am specifically curious about WordPress blogs. But any solution will give me a lead. Thanks, Tal -- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostati

Re: [R] How do I specify a partially completed survival analysis model?

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 11:07 AM, RWilliam wrote: In reply to suggestion by David W., setting an offset parameter doesn't seem to work as R is not recognizing the "X2" part of coxph( Surv(Time,Censor)~X1, offset=log(4.3*X2), data= a ). Also, here's some sample data: The problem, arising as

[R] problem with predict from nnet package

2009-11-20 Thread Mauricio Romero
Hi, I’m having mayor issues with predict from the nnet package. I’m training a neural network for forecasting. I trained the network with info from 1995 to 2009 and I want to forecast month by month 2010.(the network forecasts one month at a time). Since I have to do iterative forecasting

[R] AKIMA: z values at a set coordinate

2009-11-20 Thread Rhelp wanted
Dear all. I am using the akima function to produce 3d contour plots using interp based on irregular data. using the eg in the akima manual library("akima") data(akima) plot(y ~ x, data = akima, main = "akima example data") with(akima, text(x, y, formatC(z,dig=2), adj = -0.1)) ## linear interpola

Re: [R] read a file into a matrix

2009-11-20 Thread Peng Yu
On Sat, Nov 21, 2009 at 11:55 AM, Steve Lianoglou wrote: >> read.delim gives me a data.frame. Is there a function that can return >> the result in a matrix rather than data.frame? > > m <- as.matrix(read.delim(..)) I knew this approach. But this takes an extra step. Is there a command that read a

Re: [R] How to concatenate expressions

2009-11-20 Thread baptiste auguie
Hi, You can try this, though I hope to learn of a better way to do it, a = c(quote(alpha),quote(beta),quote(gamma)) b = lapply(1:3, function(x) as.character(x)) c = c(quote('-10'^th), quote('-20'^th), quote('-30'^th)) testplot <- function(a,b,c) { text <- lapply(seq_along(a), function(i

Re: [R] read a file into a matrix

2009-11-20 Thread Steve Lianoglou
read.delim gives me a data.frame. Is there a function that can return the result in a matrix rather than data.frame? m <- as.matrix(read.delim(..)) -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College o

[R] read a file into a matrix

2009-11-20 Thread Peng Yu
read.delim gives me a data.frame. Is there a function that can return the result in a matrix rather than data.frame? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.o

[R] nlmeODE posthoc

2009-11-20 Thread Leonid Gibiansky
Dear All, I am new to this list, and also to population modeling with R (nlmeODE). Could someone send me a simple example how to do posthoc-type estimate (for example, for the Theoph.nlme model in PKPDmodels library): I have a PK model, and I have a new subject. How to estimate individual par

Re: [R] how to draw image of a data distribution? Thanks

2009-11-20 Thread Clint Bowman
with(p,plot(x,y,pch=20,col=1+as.integer(value))) -- Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(

Re: [R] ctree (party) changing font sizes in plots

2009-11-20 Thread Achim Zeileis
On Fri, 20 Nov 2009, Sam Thomas wrote: When plotting Binary Trees (ctree) from the party package, is there a way to adjust the font sizes of the leaves? Currently, this is not implemented in "party". In interactive usage it is not easy to change the fontsize. If you're printing to PDF, you co

[R] how to draw image of a data distribution? Thanks

2009-11-20 Thread Senlin Liang
I have a file with 3 cols as: xyvalue 110.5000 121.8333 134. 210.7500 220.7500 234 310.7500 321.4167 335.1667 I read them in using p <- read.table("data.txt", header=TRUE) My questoin: how to draw a image to show

[R] ctree (party) changing font sizes in plots

2009-11-20 Thread Sam Thomas
When plotting Binary Trees (ctree) from the party package, is there a way to adjust the font sizes of the leaves? require(party) irisct <- ctree(Species ~ ., data = iris) plot(irisct) I want to adjust the font sizes for "Node 2", "Node 5", etc. I'd also like to be able to adjust the fo

[R] How to concatenate expressions

2009-11-20 Thread Sebastien Bihorel
Dear R-users, I am developing a plotting function, which receives expressions and character/numerical vectors as part of the many input arguments and which tries to concatenate them before displaying the result to the plot. I currently cannot find a way to make this concatenation works. I hav

Re: [R] HTML help missing?

2009-11-20 Thread Duncan Murdoch
On 20/11/2009 7:11 AM, Antje wrote: Hey there, I'm running R 2.10 on Windows XP (Professional) and I was wondering where the HTML help window disappeared? With earlier versions everything was fine. Now I get only this old-fashioned text windows without any links when I type ?some_function Can

Re: [R] How do I specify a partially completed survival analysis model?

2009-11-20 Thread RWilliam
In reply to suggestion by David W., setting an offset parameter doesn't seem to work as R is not recognizing the "X2" part of coxph( Surv(Time,Censor)~X1, offset=log(4.3*X2), data= a ). Also, here's some sample data: X1 X2 TimeCensor 1 1 0.40619454 77.00666

Re: [R] R 2.10 'memory leak'? on OS X

2009-11-20 Thread David Winsemius
Probably best further discussed on R-SIG-Mac list: https://stat.ethz.ch/mailman/listinfo/r-sig-mac ... since that is where the tricks of convincing MacOSX to display system files is discussed and a semi-regular basis: https://stat.ethz.ch/pipermail/r-sig-mac/2009-November/006768.html https:

Re: [R] symbol in the plot

2009-11-20 Thread Johannes Graumann
plot(sigma, delta1, ylim=range(-0.5, 2), xlab='sigma', ylab='delta',pch=22, type='o') points(sigma, delta2, col='red', axes=FALSE, pch=1,type='o') legend("topleft",c(expression(Delta*1),expression(delta*2)),fill=TRUE,col=c("black","red"),pch=c(1,22)) See: >?plotmath Still, gimme a easily runnabl

Re: [R] Remove leading and trailing white spaces

2009-11-20 Thread Gabor Grothendieck
See: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/40714.html There are many packages which have this functionality as well and a search (??, RSiteSearch, rseek.org) will find them. The links box on the http://gsubfn.googlecode.com page has links to regular expression pages on the web. On Fri,

Re: [R] R 2.10 'memory leak'? on OS X

2009-11-20 Thread Duncan Murdoch
On 20/11/2009 10:38 AM, Stropharia wrote: Thanks Duncan, I managed to get R to start through the terminal this way. Still no luck getting the R.app to start. Is it possible to directly access (and then trash or modify) the .RData and .RProfile files? I assume they would be recreated if I could t

Re: [R] can R scripts detect signals sent by the task scheduler ?

2009-11-20 Thread Prof Brian Ripley
On Fri, 20 Nov 2009, Barry Rowlingson wrote: On Fri, Nov 20, 2009 at 1:25 PM, wrote: In general, is it possible to run R scripts through cron jobs ? Yes, the only problem might be if you use anything that needs a graphics window. In the old days you needed an X11 display to create png graph

Re: [R] Remove leading and trailing white spaces

2009-11-20 Thread jim holtman
try this: > x <- ' middle of the string ' > sub("^[[:space:]]*(.*?)[[:space:]]*$", "\\1", x, perl=TRUE) [1] "middle of the string" On Fri, Nov 20, 2009 at 10:51 AM, Bos, Roger wrote: > I have a character string and I would like to remove the leading and > tailing white spaces.  The ex

Re: [R] Bessel function with large index value

2009-11-20 Thread Martin Maechler
> "DS" == David Scott > on Sat, 21 Nov 2009 02:29:38 +1300 writes: DS> This is a reply to my own question. I thought I had found an answer but DS> it seems not so (some analysis follows below). Maybe Martin Maechler or DS> Robin Hankin or Duncan Murdoch may have some ide

[R] Remove leading and trailing white spaces

2009-11-20 Thread Bos, Roger
I have a character string and I would like to remove the leading and tailing white spaces. The example for 'sub' shows how to remove the trailing white spaces, but I still can't figure out how to remove both trailing and leading white spaces because I can't find any documentation for what "+$" mea

Re: [R] symbol in the plot

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 10:23 AM, gcheer3 wrote: Thanks for your reply. It is very helpful. I am sorry I didn't make my queston clearer. I have two concerns about this graph. One thing is denote 'sigma' and 'delta' as greek letters, usually I use 'expression'. But I don't know how to use 'e

Re: [R] symbol in the plot

2009-11-20 Thread gcheer3
Joh, thank you very much. sorry for confusing you. I didn't make my question clear. I tried your code it looks much better than my original one. Just I prefer I can write the greek letter delta1 and delta 2 instead of words 'delta1' and 'delta2'. Also, it will be nice if there is a square symbol

Re: [R] R 2.10 'memory leak'? on OS X

2009-11-20 Thread Stropharia
Thanks Duncan, I managed to get R to start through the terminal this way. Still no luck getting the R.app to start. Is it possible to directly access (and then trash or modify) the .RData and .RProfile files? I assume they would be recreated if I could then open the R.app. Having searched for the

Re: [R] find data (date) gaps in time series

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 9:21 AM, Marc Schwartz wrote: On Nov 20, 2009, at 8:04 AM, David Winsemius wrote: On Nov 20, 2009, at 6:26 AM, Stefan Strohmeier wrote: Dear R users, I have a time series of precipitation data. The time series comprises ~ 20 years and it is supposed to be constant (o

Re: [R] denoting max value in ylim

2009-11-20 Thread Sundar Dorai-Raj
ylim = c(0, max(log10(D10$Part.P))) Make sure you remove any 0s or NAs before computing the max though. --sundar On Fri, Nov 20, 2009 at 6:12 AM, helene frigstad wrote: > > Hi, > > is there any way to set the ylim range from zero to whatever is the max > value in that dataset? I am plotting man

Re: [R] symbol in the plot

2009-11-20 Thread gcheer3
Thanks for your reply. It is very helpful. I am sorry I didn't make my queston clearer. I have two concerns about this graph. One thing is denote 'sigma' and 'delta' as greek letters, usually I use 'expression'. But I don't know how to use 'expression' in the 'legend' The other thing is, the gra

[R] denoting max value in ylim

2009-11-20 Thread helene frigstad
Hi, is there any way to set the ylim range from zero to whatever is the max value in that dataset? I am plotting many similar plots to the one below, and would like to avoid having to find the max value each time. plot (D10$Part.P ~ D10$Klorofyll,pch=16,log = "xy", xlab = ("Chla"), ylab = ("PO

[R] denoting max value in ylim

2009-11-20 Thread helene frigstad
Hi, is there any way to set the ylim range from zero to whatever is the max value in that dataset? I am plotting many similar plots to the one below, and would like to avoid having to find the max value each time. plot (D10$Part.P ~ D10$Klorofyll,pch=16,log = "xy", xlab = ("Chla"), ylab = ("PO

Re: [R] can R scripts detect signals sent by the task scheduler ?

2009-11-20 Thread Barry Rowlingson
On Fri, Nov 20, 2009 at 1:25 PM, wrote: > In general, is it possible to run R scripts through cron jobs ? Yes, the only problem might be if you use anything that needs a graphics window. In the old days you needed an X11 display to create png graphics with the png() function, but not any more.

Re: [R] can R scripts detect signals sent by the task scheduler ?

2009-11-20 Thread Dirk Eddelbuettel
On 20 November 2009 at 14:25, mau...@alice.it wrote: | In general, is it possible to run R scripts through cron jobs ? | Is it possible to make the script detect the system interrupt, save its current status and then exit so that next time it is rescheduled it can pick up from where it left ?

  1   2   >