[R] Tolearance Interval calculation for each point in a data set?

2013-06-24 Thread Johannes Graumann
Hello, I am looking for tolerance interval related methodologies and found the package tolerance which will e.g. nicely calculate the 95%/95% tolerance limits of a given regression. What I am looking for, however is not only the the tolerance limits this calculation defines, but I would like

[R] Construct plot combination using grid without plotting and retrieving an object?

2013-05-24 Thread Johannes Graumann
Hi, I'm currently combining multiple plots using something along the lines of the following pseudo-code: library(grid) grid.newpage() tmpLayout - grid.layout( nrow=4, ncol=2) pushViewport(viewport(layout = tmpLayout)) and than proceeding with filling the viewports ... works fine, but

[R] grep help (character ommission)

2013-05-01 Thread Johannes Graumann
Hello, Banging my head against a wall here ... can anyone light the way to a pattern modification that would make the following TRUE? identical( grep( ^Intensity\\s[^HL], c(Intensity,Intensity L, Intensity H, Intensity Rep1)), as.integer(c(1,4))) Thank you for your time.

Re: [R] Peak detector help!?

2013-02-07 Thread Johannes Graumann
Johannes Graumann wrote: Grrr ... new trial with code here: http://pastebin.com/RjHNNG9J Maybe the amount of inline-code prevented posting? Hello, I am writing a simple peak detector and it works quite well ... however there's one special case below, that I can't get my head wrapped

[R] Peak detector help!?

2013-02-06 Thread Johannes Graumann
Grrr ... new trial with code here: http://pastebin.com/RjHNNG9J Maybe the amount of inline-code prevented posting? Hello, I am writing a simple peak detector and it works quite well ... however there's one special case below, that I can't get my head wrapped around ... the problem is in the

[R] R CMD check: Error in get(ptime, pos = CheckExEnv) ...

2013-01-29 Thread Johannes Graumann
Hi, Does anyboody have insight into what this error terminating R CMD check on an in-house package may imply? ### cat(Time elapsed: , proc.time() - get(ptime, pos = 'CheckExEnv'),\n) Error in get(ptime, pos = CheckExEnv) : unused argument(s) (pos = CheckExEnv) Calls: cat - cat.default -

Re: [R] R CMD check: Error in get(ptime, pos = CheckExEnv) ...

2013-01-29 Thread Johannes Graumann
Prof Brian Ripley wrote: On 30/01/2013 06:02, Johannes Graumann wrote: Hi, Does anyboody have insight into what this error terminating R CMD check on an in-house package may imply? You have re-defined cat(), so I guess you re-defined get() too. Aha! cat not, but one of my functions

[R] parse/eval and character encoded expressions: How to deal with non-encoding strings?

2013-01-27 Thread Johannes Graumann
Hi, I am intending to save a path-describing character object in a slot of a class I'm working on. In order to have the option to use system.file etc in such string-saved path definitions, I wrote this ExpressionEvaluator - function(x){ x - tryCatch( expr=base::parse(text=x), error =

[R] Class definition and contains: No definition was found for superclass

2012-12-09 Thread Johannes Graumann
Hi, What goes wrong when the following error shows up: Error in reconcilePropertiesAndPrototype(name, slots, prototype, superClasses, : No definition was found for superclass “sequencesuperclass” in the specification of class “sequences” Has this something to do with recursive class

Re: [R] ggplot2: varwidth-equivalent for geom_boxplot?

2012-11-18 Thread Johannes Graumann
On Thursday, March 11, 2010 10:07:17 PM UTC+3, hadley wickham wrote: No this currently isn't possible - it would require changes to stat_boxplot to work. Hadley On Wed, Mar 10, 2010 at 9:12 AM, Johannes Graumann johannes...@web.de javascript: wrote: Apologies. from the boxplot

[R] devtools - document() weiredness

2012-11-14 Thread Johannes Graumann
Hello, Please try this: library(devtools) create(mdaa) setwd(mdaa) dev_mode() d install() Produces ...* DONE (mdaa) Reloading installed mdaa But when I then try to build documentation d document() devtools/roxygen just hangs with a ? like so: Updating mdaa documentation Loading mdaa ? I

[R] How to document Reference Classes using Roxygen? Will Roxygen3 work for those?

2012-11-12 Thread Johannes Graumann
Hi, Please see the subject line ;) Goolge only let me to people asking the same question, but no answers ... Am I out of luck with trying to in-line document Reference Classes? Thank you for your input. Sincerely, Joh __ R-help@r-project.org mailing

[R] Dabbling with R5 setRefClass - Inheritance problems

2012-11-08 Thread Johannes Graumann
Hello, I wrote a class like so: rcfdpsuperclass - setRefClass( Class=rcfdpsuperclass, fields = list( RcfpdVersion = character), methods = list( initialize = function(){ 'Populates fields with defaults and lock as appropriate' initFields( RcfpdVersion =

Re: [R] Dabbling with R5 setRefClass - Inheritance problems

2012-11-08 Thread Johannes Graumann
://www.ageuk.org.uk/professional-resources-home/knowledge-hub- evidence-statistics/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Johannes Graumann Sent: 08 November 2012 10:03 To: r-h...@stat.math.ethz.ch Subject: [R] Dabbling with R5

Re: [R] R5: Lock a class field from within a method?

2012-10-25 Thread Johannes Graumann
David Winsemius wrote: On Oct 24, 2012, at 2:14 AM, Johannes Graumann wrote: Hello, testclass - setRefClass( testclass, fields = list(testfield = logical), methods = list(validate=function(){testfield-TRUE})) test - testclass$new() test$testfield logical(0) test$validate

[R] R5: Lock a class field from within a method?

2012-10-24 Thread Johannes Graumann
Hello, testclass - setRefClass( testclass, fields = list(testfield = logical), methods = list(validate=function(){testfield-TRUE})) test - testclass$new() test$testfield logical(0) test$validate() test$testfield [1] TRUE Works just fine for me. I would love to be able to do something

[R] R-implementation of Local Outlier Probabilities (LoOP)?

2012-07-15 Thread Johannes Graumann
Dear all, Is anyone aware of an R implementation of LoOF (H.-P. Kriegel, P. Kröger, E. Schubert, A. Zimek; LoOP: Local Outlier Probabilities; In Proceedings of the 18th ACM Conference on Information and Knowledge Management (CIKM), Hong Kong, China: 1649–1652, 2009.)? I found http://cran.r-

Re: [R] Vector-subsetting with ZERO - Is behavior changeable?

2011-10-10 Thread Johannes Graumann
Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Johannes Graumann Sent: Wednesday, October 05, 2011 4:29 AM To: r-h...@stat.math.ethz.ch Subject: [R] Vector-subsetting with ZERO

[R] Vector-subsetting with ZERO - Is behavior changeable?

2011-10-05 Thread Johannes Graumann
Dear All, I have trouble generizising some code. index - 0 sapply(list(c(1,2,3),c(1,2),c(1)),function(x){x[max(length(x)-index,0)]}) Will yield a wished for vector like so: [1] 3 2 1 But in this case (trying to select te second to last element in each vector of the list) index - 1

[R] Prevent 'R CMD check' from reporting NA/NA_character_ missmatch?

2011-07-04 Thread Johannes Graumann
Hello, I'm writing a package am running 'R CMD check' on it. Is there any way to make 'R CMD check' not warn about a missmatch between 'NA_character_' (in the function definition) and 'NA' (in the documentation)? Thanks for any help. Sincerely, Joh

Re: [R] Prevent 'R CMD check' from reporting NA/NA_character_ missmatch?

2011-07-04 Thread Johannes Graumann
Prof Brian Ripley wrote: On Mon, 4 Jul 2011, Johannes Graumann wrote: Hello, I'm writing a package am running 'R CMD check' on it. Is there any way to make 'R CMD check' not warn about a missmatch between 'NA_character_' (in the function definition) and 'NA' (in the documentation

[R] read.table mystery

2011-03-06 Thread Johannes Graumann
Hello, Please have a look at the code below, which I use to read in the attached file. As line 18 of the file reads 1065:sp|Q9V3T9|ADRO_DROME NADPH:adrenodoxin oxidoreductase, mitochondrial OS=Drosophila melanogaster GN=dare PE=2 SV=1, I expect the code below to produce a 3 column data frame

Re: [R] read.table mystery

2011-03-06 Thread Johannes Graumann
, Johannes Graumann johannes_graum...@web.de wrote: Hello, Please have a look at the code below, which I use to read in the attached file. As line 18 of the file reads 1065:sp|Q9V3T9|ADRO_DROME NADPH:adrenodoxin oxidoreductase, mitochondrial OS=Drosophila melanogaster GN=dare PE=2 SV=1, I

Re: [R] read.table mystery

2011-03-06 Thread Johannes Graumann
On Sun, Mar 6, 2011 at 12:47 PM, Johannes Graumann johannes_graum...@web.de wrote: Thank you for pointing this out. This is really inconvenient as I do not know a priori how many and where those darn cases containing an additional (or more) : might be ... The seems to work

Re: [R] read.table mystery

2011-03-06 Thread Johannes Graumann
count.fields is a very nice hint for a clean solution - thank you! Joh On Sunday 06 March 2011 21:48:32 David Winsemius wrote: On Mar 6, 2011, at 12:47 PM, Johannes Graumann wrote: Thank you for pointing this out. This is really inconvenient as I do not know a priori how many and where

Re: [R] Finding NAs in DF

2011-01-18 Thread Johannes Graumann
of columns with NAs apply(row.na, 2, function(a) paste(colnames(x)[a], collapse = ',')) [1] B A,B A On Mon, Jan 17, 2011 at 5:01 AM, Johannes Graumann johannes_graum...@web.de wrote: Hi, What is an efficient way to take this DF data.frame(A=c(1,2,NA,NA),B=c(1,NA,NA,4)) and get c(NA

[R] Finding NAs in DF

2011-01-17 Thread Johannes Graumann
Hi, What is an efficient way to take this DF data.frame(A=c(1,2,NA,NA),B=c(1,NA,NA,4)) and get c(NA,TWO,BOTH,ONE) as the result, where NA corresponds to a row without NAs, TWO indicates NA in the second and ONE in the first column. Thanks for any pointers. Joh

Re: [R] Finding NAs in DF

2011-01-17 Thread Johannes Graumann
[is.na(x)])) [1] 0 1 2 1 There might be better ways to do it, but it works HTH, Ivan Le 1/17/2011 11:01, Johannes Graumann a écrit : Hi, What is an efficient way to take this DF data.frame(A=c(1,2,NA,NA),B=c(1,NA,NA,4)) and get c(NA,TWO,BOTH,ONE) as the result

[R] Install Error

2010-10-28 Thread Johannes Graumann
Hi, I'm running into the error below when doing R CMD INSTALL MyPackage.tar.gz. This didn't use to be this way and I am at a loss as to where this might be coming from. Any pointers where to look? Joh ** building package indices ... Error in scan(file, what, nmax, sep, dec, quote, skip,

Re: [R] Install Error

2010-10-28 Thread Johannes Graumann
Duncan Murdoch wrote: On 28/10/2010 7:54 AM, Johannes Graumann wrote: Hi, I'm running into the error below when doing R CMD INSTALL MyPackage.tar.gz. This didn't use to be this way and I am at a loss as to where this might be coming from. Any pointers where to look? Joh ** building

[R] [SOLVED] Re: Install Error

2010-10-28 Thread Johannes Graumann
Johannes Graumann wrote: Hi, I'm running into the error below when doing R CMD INSTALL MyPackage.tar.gz. This didn't use to be this way and I am at a loss as to where this might be coming from. Any pointers where to look? Joh ** building package indices ... Error in scan(file, what

Re: [R] [SOLVED] Re: Install Error

2010-10-28 Thread Johannes Graumann
Johannes Graumann wrote: Johannes Graumann wrote: Hi, I'm running into the error below when doing R CMD INSTALL MyPackage.tar.gz. This didn't use to be this way and I am at a loss as to where this might be coming from. Any pointers where to look? Joh ** building package indices

[R] Function execution on package load?

2010-10-20 Thread Johannes Graumann
Hi, Can anyone give me a pointer on howto make a package execute a function at loading? Following an older post (http://bit.ly/cS1Go4), I'd like to do something along the lines of .localstuff - new.env() .localstuff$OftenUsedData - read.csv(...) upon loading the package ... Thanks, Joh

Re: [R] Splitting a DF into rows according to a column

2010-10-05 Thread Johannes Graumann
Stupid Joh wants to give you a big hug! Thanks! Why rank works but order not, I have still to figure out, though ... Joh On Monday 04 October 2010 17:30:32 peter dalgaard wrote: On Oct 4, 2010, at 16:57 , Johannes Graumann wrote: Hi, I'm turning my wheels on this and keep coming around

[R] Splitting a DF into rows according to a column

2010-10-04 Thread Johannes Graumann
Hi, I'm turning my wheels on this and keep coming around to the same wrong solution - please have a look and give a hand ... The premise is: a DF like so loremIpsum - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque leo ipsum, ultricies scelerisque volutpat non, volutpat et

[R] choose.dir() gone?

2010-09-08 Thread Johannes Graumann
Hi, I fail to find choose.dir() in my current R install (see below)? Didn't that exist at some point? How to achieve file.choose() equivalent functionality for directories? Thanks for any hints, Joh sessionInfo() R version 2.11.1 (2010-05-31) x86_64-pc-linux-gnu locale: [1]

Re: [R] choose.dir() gone?

2010-09-08 Thread Johannes Graumann
OK. Just checked and choose.file/choose.dir exists in the windows version - apparently not in the linux one ... does anybody have a nice platform-agnostic solution for this? Thanks, Joh Johannes Graumann wrote: Hi, I fail to find choose.dir() in my current R install (see below)? Didn't

Re: [R] getNodeSet - what am I doing wrong?

2010-08-31 Thread Johannes Graumann
() So getNodeSet(test, //x:modifications_row, x) gives you probably what you want. D. On 8/30/10 8:02 AM, Johannes Graumann wrote: library(XML) test - xmlTreeParse( http://www.unimod.org/xml/unimod_tables.xml,useInternalNodes=TRUE) getNodeSet(test,//modifications_row

Re: [R] getNodeSet - what am I doing wrong?

2010-08-31 Thread Johannes Graumann
Sorry about that - got dropped from my attempts yesterday (see the first example below, that has the useInternalNodes=TRUE) ... Thanks again, Joh Duncan Temple Lang wrote: Johannes Graumann wrote: Thanks! but: library(XML) xmlDoc - xmlTreeParse(http://www.unimod.org/xml

[R] getNodeSet - what am I doing wrong?

2010-08-30 Thread Johannes Graumann
Hi, Why is the following retuning a nodset of length 0: library(XML) test - xmlTreeParse( http://www.unimod.org/xml/unimod_tables.xml,useInternalNodes=TRUE) getNodeSet(test,//modifications_row) Thanks for any hint. Joh __ R-help@r-project.org

Re: [R] grid.table and expression in table body?

2010-08-17 Thread Johannes Graumann
. baptiste On 6 August 2010 17:11, Johannes Graumann johannes_graum...@web.de wrote: I updated the package from r-forge, but despite the fact that grid.table does not complain about the parse option if given, your example below is not being printed as a parsed expression. How can I check

Re: [R] Relation 1.5*IQR/Percentile in case of a normal Distribution

2010-08-15 Thread Johannes Graumann
On Saturday 14 August 2010 23:08:31 Peter Dalgaard wrote: Johannes Graumann wrote: Hi, can someone point me at material to understand how in http://upload.wikimedia.org/wikipedia/commons/8/89/Boxplot_vs_PDF.png the fivenum-corresponding percentages might be calculated? Looks like

[R] Relation 1.5*IQR/Percentile in case of a normal Distribution

2010-08-14 Thread Johannes Graumann
Hi, can someone point me at material to understand how in http://upload.wikimedia.org/wikipedia/commons/8/89/Boxplot_vs_PDF.png the fivenum-corresponding percentages might be calculated? Thanks, Joh __ R-help@r-project.org mailing list

Re: [R] grid.table and expression in table body?

2010-08-04 Thread Johannes Graumann
- data.frame(alpha, beta) grid.table(d, parse=T) you'll need revision 258 of gridExtra for this to work (googlecode now, r-forge in the following days, CRAN in the next stable version). HTH, baptiste On Aug 4, 2010, at 9:56 AM, Johannes Graumann wrote: Hi Baptiste, This is, I fear a bit

[R] grid.table and expression in table body?

2010-08-03 Thread Johannes Graumann
Hi, Is there any way to get an expression into a data.frame, such that grid.table from gridExtra will plot it evaluated in the table body? The docu does it for the header, but is the body possible? Thanks, Joh __ R-help@r-project.org mailing list

[R] List to data frame

2010-07-26 Thread Johannes Graumann
Hi, Any ideas on how to efficiently convert list(c(1,2,3),c(4,5,6)) to data.frame(OriginalListIndex=c(1,1,1,2,2,2),Item=c(1,2,3,4,5,6)) Thanks for any hints, Joh __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] List to data frame

2010-07-26 Thread Johannes Graumann
(x = seq_along(mydata), times = unlist(lapply(mydata, length))), Item = unlist(mydata) ) HTH, Josh On Mon, Jul 26, 2010 at 7:46 AM, Johannes Graumann johannes_graum...@web.de wrote: Hi, Any ideas on how to efficiently convert list(c(1,2,3),c(4,5,6

Re: [R] Apply: Output matrix orientation

2010-05-28 Thread Johannes Graumann
David Winsemius wrote: On May 27, 2010, at 7:24 AM, Johannes Graumann wrote: Hi, Why is the result of below apply call rotated with respect to the input and how to remedy this? Because the processing you requested is with respect to rows and the construction of matrices

[R] Apply: Output matrix orientation

2010-05-27 Thread Johannes Graumann
Hi, Why is the result of below apply call rotated with respect to the input and how to remedy this? Thanks, Joh .ZScore - function(input){ #cat(input,\n) z - (input - mean(input))/sd(input) return(z) } apply(data.frame(x1=c(1,2,3,4,5),x2=c(2,3,4,5,6),x3=c(3,4,5,6,7)),1,.ZScore)

Re: [R] error bars on barplot

2010-04-09 Thread Johannes Graumann
Jim Lemon wrote: On 04/09/2010 08:55 PM, Samantha Reynolds wrote: Hi I was hoping someone might be able to help me I have this data: birdid timetaken numvisits ptachchoice time bold 1087 810 1 AM0 108728 6 1 PM0

[R] ggplot2, density barplot and geom_point layer

2010-04-07 Thread Johannes Graumann
Hi, Please consider the example below. How can I manage to overlay the points the way I want in the second case? Thanks, Joh library(ggplot2) # Modify data to match real case myDiamonds - diamonds myDiamonds[[clarity]] - as.character(myDiamonds[[clarity]])

Re: [R] ggplot2, density barplot and geom_point layer

2010-04-07 Thread Johannes Graumann
Thanks so much. Solved. Joh hadley wickham wrote: Because of the way you've constructed the plot with qplot, you need to use: myPlot + geom_point( data=medians, aes(x=med,shape=cut, y=0), size=2.5, ) Hadley On Wed, Apr 7, 2010 at 5:11 AM, Johannes Graumann johannes_graum

[R] ggplot2: Adding points to a density plot

2010-03-31 Thread Johannes Graumann
Hi, Consider something like library(ggplot2) movies$decade - round_any(movies$year, 10) m - qplot(rating,data=movies,colour=factor(decade),geom=density) m (modified from ?stat_density). I'd like to add on the line y=0 a dot for the median of each decade category (using the same colour

Re: [R] ggplot2: Adding points to a density plot

2010-03-31 Thread Johannes Graumann
Thanks a lot! This got me started! Joh Dennis Murphy wrote: Hi: Try this: library(ggplot2) movmed - ddply(movies, .(decade), summarise, med = median(rating)) m + geom_point(data = movmed, aes(x = med), y = 0, size = 2) HTH, Dennis On Wed, Mar 31, 2010 at 4:46 AM, Johannes

Re: [R] Lattice: barchart, error bars and grouped data

2010-03-10 Thread Johannes Graumann
Thanks. I switched to ggplot2 which offers error bars. Joh Dieter Menne wrote: Johannes wrote: How can I, given the code snippet below, draw the error bars in the center of each grouped bar rather than in the center of the group? http://markmail.org/message/oljgimkav2qcdyre

[R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-10 Thread Johannes Graumann
Hello, I'd like to sitch to a monochrome/bw color-palette for the filling of geom_bar-bars (produced via qplot as in the example below). Hours of googling didn't yield anything useful, so I thought, I'd just ask ... Thanks, Joh library(ggplot2) qplot(factor(cyl), data=mtcars, geom=bar,

Re: [R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-10 Thread Johannes Graumann
Indeed. Thank you. Is there a global switch analogous to theme_set(theme_bw())? thanks for your help, Joh On Wednesday 10 March 2010 10:29:05 baptiste auguie wrote: Hi, last_plot() + scale_fill_grey() should do it HTH, baptiste On 10 March 2010 09:46, Johannes Graumann

Re: [R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-10 Thread Johannes Graumann
Works. Thank you! Joh On Wednesday 10 March 2010 11:13:09 you wrote: not with the theme, as far as I know, but you can do: set_default_scale(fill, discrete,grey) baptiste On 10 March 2010 10:31, Johannes Graumann johannes_graum...@web.de wrote: Indeed. Thank you. Is there a global

[R] ggplot2: varwidth-equivalent for geom_boxplot?

2010-03-10 Thread Johannes Graumann
Hi, Is there such a thing? If no: is it easily simulated? thanks, Joh __ 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.org/posting-guide.html and provide commented,

Re: [R] ggplot2: varwidth-equivalent for geom_boxplot?

2010-03-10 Thread Johannes Graumann
On Wednesday 10 March 2010 16:12:49 hadley wickham wrote: What is varwidth? Hadley On Wed, Mar 10, 2010 at 1:55 PM, Johannes Graumann johannes_graum...@web.de wrote: Hi, Is there such a thing? If no: is it easily simulated? thanks, Joh

[R] Lattice: barchart, error bars and grouped data

2010-03-08 Thread Johannes Graumann
Hi, How can I, given the code snippet below, draw the error bars in the center of each grouped bar rather than in the center of the group? Thanks for any hints, Joh library(lattice) barley[[SD]] - 5 barchart( yield ~ variety | site, data = barley, groups=year, origin=0,

Re: [R] Lattice: How to implement varwidth analogous to graphics::boxplot in bwplot?

2010-02-15 Thread Johannes Graumann
Johannes Graumann wrote: Has anybody solved this? For the benefit of others: after studying ?panel.bwplot I have to admit that bwplot(..., varwidth = TRUE) solves the issue. It's just not documented at ?bwplot Cheers, Joh

[R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Johannes Graumann
Hello, When drawing barcharts, I find it not helpful if ylim[1] != 0 - bars for a quantity of 0, that do not show a length of 0 are quite non-intuitive. I have tried to study library(lattice) panel.barchart but am unable to figure out where ylim is taken care of and how one

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Johannes Graumann
David Winsemius wrote: On Feb 14, 2010, at 10:33 AM, Johannes Graumann wrote: Hello, When drawing barcharts, I find it not helpful if ylim[1] != 0 - bars for a quantity of 0, that do not show a length of 0 are quite non-intuitive. I have tried to study library(lattice

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Johannes Graumann
Deepayan Sarkar wrote: On Sun, Feb 14, 2010 at 7:33 AM, Johannes Graumann johannes_graum...@web.de wrote: Hello, When drawing barcharts, I find it not helpful if ylim[1] != 0 - bars for a quantity of 0, that do not show a length of 0 are quite non-intuitive. I have tried to study

Re: [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

2010-02-14 Thread Johannes Graumann
Rolf Turner wrote: On 15/02/2010, at 9:40 AM, Johannes Graumann wrote SNIP (In response to some advice from David Winsemius): I am quite certain that this is the most elaborately worded version of RTFM I have ever come across. I nominate this as a fortune. (Despite Prof

[R] Lattice: How to implement varwidth analogous to graphics::boxplot in bwplot?

2010-02-12 Thread Johannes Graumann
Hello, Has anybody solved this? Thanks, Joh __ 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.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] memDecompress and zlib compressed base64 encoded string

2010-01-15 Thread Johannes Graumann
was stripped, such files are 8-bit and yours is ASCII. Try x - 'Johannes Graumann' xx - charToRaw(x) xxx - memCompress(xx, g) rawToChar(xxx) [1] x\x9c\xf3\xca\xcfH\xcc\xcbK-Vp/J,\xcd\0052\001:\n\006\x90 to see what a real gzipped string looks like. and would like to decompress them using

[R] memDecompress and zlib compressed base64 encoded string

2010-01-14 Thread Johannes Graumann
Hi, I have zlib compressed strings (example is attached) and would like to decompress them using memDecompress ... I try this: connection - file(compressed.txt,r) compressed - readLines(connection) memDecompress(as.raw(compressed),type=g) Error in memDecompress(as.raw(compressed), type = g)

Re: [R] Method

2009-11-24 Thread Johannes Graumann
myVector - c(seq(10),23,35) length(myVector) myVector[length(myVector)] it's unclear to me which of the two you want ... HTH, Joh yonosoyelmejor wrote: Hello, i would like to ask you another question. Is exist anymethod to vectors that tells me the last element?That is to say,I have a

Re: [R] symbol in the plot

2009-11-20 Thread Johannes Graumann
How about 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,c(Delta1,Delta2),fill=TRUE,col=c(black,red)) Send runnable example next time. HTH, Joh gcheer3 wrote: TO be specific, here

Re: [R] symbol in the plot

2009-11-20 Thread Johannes Graumann
'. Also, it will be nice if there is a square symbol next to delta1 and a circle symbol next to delta 2, since sometimes I have to print the graph in a white and black paper. Thanks for any suggestions. Sorry for not asking question clearly. Johannes Graumann-2 wrote: How about plot(sigma

Re: [R] Normal distribution test

2009-11-17 Thread Johannes Graumann
Markus Mehrwald wrote: Hi all, I am completely new to R and my knowledge of statistics is quite small so I hope you can help my. I have three dimensional point data which represents (and this is what I do not know for sure) a normal distribution. Now I want to test if this is true or not

[R] How to identify what is used as EOL in a given file?

2009-11-09 Thread Johannes Graumann
Hi, Is there any R-generic, OS-agnostic way to figure out what end-of-line character is being used in a file to be processed by readLines? Thanks, Joh __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] Scanning grep through huge files

2009-11-03 Thread Johannes Graumann
Hi, I'm dealing which huge files I would like to index. On a linux system grep -buo PATTERN FILENAME hands me the byte offsets for PATTERN very quickly and I am looking to emulate that speed and ease with native R tools - for portability and elegance. gregexpr should be able to do that but I

Re: [R] Regex matching that gives byte offset?

2009-11-02 Thread Johannes Graumann
the character offset: if you want to match in a MBCS and have byte offsets you will need to work a bit harder if useBytes=TRUE is not sufficient for you. On Wed, 28 Oct 2009, Johannes Graumann wrote: Hi, Is there any way of doing 'grep' ore something like it on the content of a text file

Re: [R] Regex matching that gives byte offset?

2009-11-02 Thread Johannes Graumann
On Monday 02 November 2009 13:41:45 Prof Brian Ripley wrote: On Mon, 2 Nov 2009, Johannes Graumann wrote: Hmmm ... that should do it, thanks. But how would one use this on a file without reading it into memory completely? ?file, ?readLines, ?readBin will tell you about connections

[R] Vector grouping challenge

2009-10-28 Thread Johannes Graumann
Dear all, Is there an efficient way to get this list testList - list(c(1),c(2,3,4),c(5,6),c(7),c(8),c(9,10,11,12),c(13)) from this vector testVector - c(12,32,NA,NA,56,NA,78,65,87,NA,NA,NA,90) ? Basically the vector should be grouped, such that non-NA and all following NAs end up in one

Re: [R] Vector grouping challenge

2009-10-28 Thread Johannes Graumann
` [1] 1 $`2` [1] 2 3 4 $`3` [1] 5 6 $`4` [1] 7 $`5` [1] 8 $`6` [1] 9 10 11 12 $`7` [1] 13 On Wed, Oct 28, 2009 at 7:57 AM, Johannes Graumann johannes_graum...@web.de wrote: Dear all, Is there an efficient way to get this list testList - list(c(1),c(2,3,4),c(5,6),c

[R] Regex matching that gives byte offset?

2009-10-28 Thread Johannes Graumann
Hi, Is there any way of doing 'grep' ore something like it on the content of a text file and extract the byte positioning of the match in the file? I'm facing the need to access rather largish (600MB) XML files and would like to be able to index them ... Thanks for any help or flogging, Joh

Re: [R] How to make XML support Expat?

2009-10-25 Thread Johannes Graumann
the expat libraries, etc. HTH, D. Johannes Graumann wrote: Hi, How can I make the result of the following lines TRUE? install.packages(XML) library(XML) supportsExpat() [1] FALSE I'm on linux, looked into the actual package, but don't seem to be able to wrap my head

Re: [R] How to make XML support Expat?

2009-10-25 Thread Johannes Graumann
24 October 2009 23:31:46 Duncan Temple Lang wrote: Johannes Graumann wrote: Hi, I had heard that Expat is was faster. Your mail actually made me go check google for some comparisons and that does not seem the case ... do you have any insight into this? A couple of points.. i

Re: [R] How to make XML support Expat?

2009-10-25 Thread Johannes Graumann
On Sunday 25 October 2009 00:38:54 you wrote: xmlEventParse() is intended for handling files that we don't want to keep in memory. The branches parameter does make it easier to deal with sub-trees as the document is being parsed. And within these branches one can use XPath. Very

[R] How to make XML support Expat?

2009-10-24 Thread Johannes Graumann
Hi, How can I make the result of the following lines TRUE? install.packages(XML) library(XML) supportsExpat() [1] FALSE I'm on linux, looked into the actual package, but don't seem to be able to wrap my head around how to compile this in ... Any pointers are welcome, Thanks Joh

Re: [R] loop and plot

2009-10-19 Thread Johannes Graumann
Rene wrote: Dear all, I am stuck at applying loop function for creating separated plots. I have coding like below: dataset.table - table(data.frame(var1=c(1,2,3,1,2,3,1),colour=c(a,b,c,c,a,b,b) )) kk = function(f) { ls=as.character(f)

Re: [R] readBin: read from defined offset TO defined offset?

2009-05-15 Thread Johannes Graumann
passing would be possible, since there's no way the thing will fit into memory). Thanks again, Joh Johannes Graumann wrote: Hello, With the help of seek I can start readBin from any byte offset within my file that I deem appropriate. What I would like to do is to be able to define

[R] readBin: read from defined offset TO defined offset?

2009-05-11 Thread Johannes Graumann
Hello, With the help of seek I can start readBin from any byte offset within my file that I deem appropriate. What I would like to do is to be able to define the endpoint of that read as well. Is there any solution to that already out there? Thanks for any hints, Joh

Re: [R] xmlEventParse returning trimmed content?

2009-04-10 Thread Johannes Graumann
= FALSE in the call to xmlEventParse(). If you specify this, you might well get the results you expect. If not, can you post the actual file you are reading so we can reproduce your results. D. Johannes Graumann wrote: Hello, I wrote the function below and have the problem

[R] xmlEventParse returning trimmed content?

2009-04-09 Thread Johannes Graumann
Hello, I wrote the function below and have the problem, that the text bit returns only a trimmed version (686 chars as far as I can see) of the content under the fetchPeaks condition. Any hunches why that might be? Thanks for pointer, Joh xmlEventParse(fileName, list(

Re: [R] Efficiency challenge: MANY subsets

2009-01-20 Thread Johannes Graumann
){ + .range - seq(.range[1], .range[2]) # save since we use several times + lapply(sequences, '[', .range) + }) + }) + }) user system elapsed 1.240.001.26 On Fri, Jan 16, 2009 at 3:16 PM, Johannes Graumann johannes_graum...@web.de wrote: Thanks. Very elegant

[R] How to get name of current function?

2009-01-20 Thread Johannes Graumann
Hello, Is there a way to get the name of the function currently running? I'd like to have something like this x - function(){ myName - getNameOfCurrentFunction cat(myName) } so that x() would result in x Thanks for any pointers,

Re: [R] How to get name of current function?

2009-01-20 Thread Johannes Graumann
Thanks a lot. Exactly what I was looking for. Joh Prof Brian Ripley wrote: On Tue, 20 Jan 2009, Johannes Graumann wrote: Hello, Is there a way to get the name of the function currently running? It may not even have a name (you can write functions anonymously as 'function(x) x+1

[R] Efficiency challenge: MANY subsets

2009-01-16 Thread Johannes Graumann
Hello, I have a list of character vectors like this: sequences - list( c(M,G,L,W,I,S,F,G,T,P,P,S,Y,T,Y,L,L,I,M, N,H,K,L,L,L,I,N,N,N,N,L,T,E,V,H,T,Y,F, N,I,N,I,N,I,D,K,M,Y,I,H,*) ) and another list of subset ranges like this: indexes - list( list( c(1,22),c(22,46),c(46,

Re: [R] Efficiency challenge: MANY subsets

2009-01-16 Thread Johannes Graumann
))]) } still very slow for length(sequences) ~ 7000. Joh On Friday 16 January 2009 14:23:47 Henrique Dallazuanna wrote: Try this: lapply(indexes[[1]], function(g)sequences[[1]][do.call(seq, as.list(g))]) On Fri, Jan 16, 2009 at 11:06 AM, Johannes Graumann johannes_graum...@web.de wrote: Hello

Re: [R] Efficient passing through big data.frame and modifying select

2008-11-26 Thread Johannes Graumann
, November 25, 2008 9:16 AM To: '[EMAIL PROTECTED]' Subject: Re: [R] Efficient passing through big data.frame and modifying select fields Johannes Graumann johannes_graumann at web.de Tue Nov 25 15:16:01 CET 2008 Hi all, I have relatively big data frames ( 1 rows by 80

[R] Efficient passing through big data.frame and modifying select fields

2008-11-25 Thread Johannes Graumann
Hi all, I have relatively big data frames ( 1 rows by 80 columns) that need to be exposed to merge. Works marvelously well in general, but some fields of the data frames actually contain multiple ;-separated values encoded as a character string without defined order, which makes the fields

Re: [R] Best way of figuring out whether graphical elements overlap?

2008-11-03 Thread Johannes Graumann
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Johannes Graumann Sent: Tuesday, October 28, 2008 8:42 AM To: [EMAIL PROTECTED] Subject: [R] Best way of figuring out whether graphical elements overlap? Hi all, I'm plotting impulses, where some

[R] plot: Howto get parameters befor plotting anything?

2008-10-30 Thread Johannes Graumann
Hello, Is it possible to get all par content calculated for plot without actually plotting anything? I'm missing an option plot=FALSE ... type=n will still open a device and draw the axes ... Thanks, Joh __ R-help@r-project.org mailing list

[R] gsubfn, strapply, REGEX Problem

2008-10-28 Thread Johannes Graumann
Hi all, I swear this used to work: library(gsubfn) strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]] But somewhere along the update path it stopped ... now giving me this Error in base::gsub(pattern, rs, x, ...) : invalid backreference 2 in regular expression Can't figure it out.

Re: [R] gsubfn, strapply, REGEX Problem

2008-10-28 Thread Johannes Graumann
in no error message. On Tue, Oct 28, 2008 at 7:39 AM, Johannes Graumann [EMAIL PROTECTED] wrote: Hi all, I swear this used to work: library(gsubfn) strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]] But somewhere along the update path it stopped ... now giving me this Error in base

  1   2   >