[R] Display warning only once in session

2014-08-25 Thread Berry Boessenkool
Hi, I'm writing a function that gives a warning in a certain scenario. Reading this once per R session will be enough. i.e. it's not necessary to be shown in subsequent function calls. What's the best way to implement this? Some package-specific option? Where would I find good information on tha

[R] LA useR ride

2014-06-17 Thread Berry Boessenkool
Hi, Is anyone travelling north after the useR! conference in Los Angeles and could give me a ride? I need to get to Medford, which is located along I5 in southern Oregon. Thanks ahead, Berry PS: sorry to bother the help list, but I could not find anything specific for useR.

[R] dim vector or data.frame

2014-02-14 Thread Berry Boessenkool
Hi, In my function, I want to allow input to be a vector or a data.frame. Certain operations need to be done if the length or nrows exceeds one, but since "nrow" doesn't work for vectors, I cannot simply use if( nrow(input)>1 | length(input)>1 ) ... So is there a more elegant way to do this the

[R] Leap hours?

2013-12-11 Thread Berry Boessenkool
Hi there, If you want to show off just how good R handles dates+times, forward this. I showed some colleagues difftime today, and encountered something interesting: difftime(ISOdatetime(1936:1947+1,1,1, 0,0,0), ISOdatetime(1936:1947,1,1, 0,0,0)) which returns the values 366, 365, 365, 365, 365.95

[R] T-shirt

2013-03-28 Thread Berry Boessenkool
Good morning to the German readers, I'm thinking about getting me a t-shirt with the proverb "R-kenntnis ist der erste Schritt auf dem Weg zur Besserung" (awareness is the first step towards improvement, the pun being that the first word can also be read as R-knowledge) 1. Could there be a probl

[R] expression exponent labeling

2013-03-13 Thread Berry Boessenkool
Hi all, I want to label an axis with exponents, but can't get it done with expression. Any hints would be very welcome! # simulated data, somewhat similarly distributed to my real data: set.seed(12); d <- rbeta(1e6, 0.2,2)*150 ; d <- d[d>1e-8] hist( d  , breaks=100) # now on a logarithmically s

[R] print justify

2013-03-06 Thread Berry Boessenkool
Hi everyone, I'm trying to print a table justified to the left, but it doesn't work. Any hints? KennArt <- data.frame(NR=c(171,172,174,175,176,177,181,411,980), TYP=c("Körnermais",  "Corn Cob Mix", "Zuckermais", "Mischanbau (Silo)Mais/Sonnenblumen",  "Mais mit Bejagungsschneise in gutem landw

[R] tabstop in graphics

2013-01-14 Thread Berry Boessenkool
Hi, I'm curious about Tab stops in graphics: plot(1) text(1.2, 1.2, "Char\nMoreChar") works fine, but text(1.2, 0.8, "Char\tMoreChar") doesn't. Exporting with pdf tells me that the sign width is unknown. I'm not into informatics, so I don't know how a tabstop actually works. Is this at all

[R] deparse substitute

2013-01-09 Thread Berry Boessenkool
Hi, I'm writing a function that needs the input names (as characterstrings) as part of the output. With deparse(substitute( ) ) that works fine, until I replace all zeros with 0.001 (log is calculated at some time): tf <- function(input) { input[input==0] <- 0.001 ; deparse(substitute(input

[R] avoid <<- in specific case

2012-10-05 Thread Berry Boessenkool
Hi all, I improved a function drawing horizontal histograms (code below) which uses barplot and works fine. It does,however, need to assign a function to the global environment to later find the actual location on the vertical axis, and not the number of bars used by barplot. Hopefully, runni

Re: [R] Changing character into date

2012-08-12 Thread Berry Boessenkool
Another helfpul function is strptime Berry -- View this message in context: http://r.789695.n4.nabble.com/Changing-character-into-date-tp4640079p4640088.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing l

[R] buffering output to the console

2012-08-02 Thread Berry Boessenkool
t positions. My question is: should I expect serious computing time issues with this setting? As posted in [5], calling flush.console too often takes a lot of time... Thanks very much, Berry Boessenkool, Potsdam [1] http://r.789695.n4.nabble.com/pause-in-function-execution-td882624.htm [2]

Re: [R] check whether connection can be opened

2012-07-19 Thread Berry Boessenkool
an be opened > Date: Wed, 18 Jul 2012 09:18:48 -0500 > To: berryboessenk...@hotmail.com > > I think you'll need to roll your own using tryCatch() around open(). > > Michael > > On Jul 18, 2012, at 5:09 AM, Berry Boessenkool > wrote: > > > > &g

[R] check whether connection can be opened

2012-07-18 Thread Berry Boessenkool
do with R? Thanks ahead, Berry Boessenkool [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

Re: [R] access objects

2011-09-07 Thread Berry Boessenkool
, Sep 7, 2011 at 12:53 PM, Berry Boessenkool wrote: hi, say I have consecutively numbered objects obj1, obj2, ... in my R workspace. I want to acces one of them inside a function, with the number given as an argument. Where can I find help on how to do that? Somebody must have been t

[R] access objects

2011-09-07 Thread Berry Boessenkool
are appreciated as well. Here's an example, I hope it clarifies what I'm trying to do: obj1 <- 7:9 obj2 <- 6:2 testf <- function(k) plot(  noquote(paste("obj", k, sep=""))  ) testf(1) # should plot obj1 ----- Ber

[R] Histogram messed up

2011-09-06 Thread Berry Boessenkool
    LC_TIME=German_Germany.1252    attached base packages: [1] stats graphics  grDevices utils datasets  methods   base   ----

Re: [R] Polynomial fitting

2011-07-09 Thread Berry Boessenkool
ide what's more elegant... Hope this helps, Berry ----- Berry Boessenkool Potsdam - > Date: Fri, 8 Jul 2011 21:12:46 +0300 > From: matti.joki...@gmail.com > To: gerrit.eich...@math.uni-giessen.de > CC: r-he

Re: [R] manipulating "by" lists and "ave()" functions

2011-07-09 Thread Berry Boessenkool
d_2.12.2  tools_2.12.2 Thanks ahead, Berry ----- Berry Boessenkool Potsdam - > From: ivo.we...@gmail.com > Date: Fri, 8 Jul 2011 16:22:18 -0700 > To: wdun...@tibco.com > CC: r-h...@stat.math.eth

Re: [R] Vertical Labels in plot graph - normally working fine but not on this graph

2011-07-08 Thread Berry Boessenkool
=1 , at = tickplaces, labels = Labels) If you only want to use las, you can also use this as an arument in the axis function. HTH, Berry --------- Berry Boessenkool Potsdam - > Date: Fri, 8 Jul 2011 13:20:51 +010

[R] show colums x till end

2011-06-27 Thread Berry Boessenkool
g) Thanks ahead, Berry ----- Berry Boessenkool University of Potsdam, Germany - __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

[R] assign using =

2011-06-27 Thread Berry Boessenkool
" is not a good idea? Or is it? Thanks ahead, Berry --------- Berry Boessenkool University of Potsdam, Germany - [[alternative HTML version deleted]] __

Re: [R] How to export to pdf in landscape orientation?

2011-06-25 Thread Berry Boessenkool
Hey Juan, paper="a4r" or "USr" for rotated (‘landscape’)) i.e. pdf(file='my_file.pdf', onefile=T, paper='A4r') plot(sin, -pi, 2*pi) ; dev.off() Greetings from Potsdam University, Germany, Berry Boessenkool > From: jhernandezcabr...@gmail.