Re: [R] Match ISO 8601 week-of-year numbers to month-of-year numbers on Windows with German locale

2017-01-18 Thread Janko Thyson
Hi Steve, and thanks so much for taking the time to draft your solution! After running through it looks like it's EXACTLY what I was looking/hoping for! For those interested: I also tried to get this in as a feature request for the lubridate package >>

Re: [R] Match ISO 8601 week-of-year numbers to month-of-year numbers on Windows with German locale

2017-01-13 Thread Janko Thyson
2, 2017 at 8:37 PM, David Winsemius <dwinsem...@comcast.net> wrote: > >> On Jan 12, 2017, at 8:14 AM, Janko Thyson <janko.thy...@gmail.com> wrote: >> >> Dear list, >> >> I'm experiencing problems with converting strings of the format >> "-&

[R] Match ISO 8601 week-of-year numbers to month-of-year numbers on Windows with German locale

2017-01-12 Thread Janko Thyson
a_0.1.0 digest_0.6.10 readxl_0.1.1dplyr_0.5.0 plyr_1.8.4 magrittr_1.5 [7] memoise_1.0.0 testthat_1.0.2 roxygen2_5.0.1 devtools_1.12.0 loaded via a namespace (and not attached): [1] Rcpp_0.12.8 lubridate_1.6.0 assertthat_0.1 packrat_0.4.8-1 crayon_1.3.2withr_1.0.2 [7] R

[R] Inconsistency of S4 dispatch behavior for R6 classes

2014-12-09 Thread Janko Thyson
Dear list, as a week has passed now after filing an issue for package R6 ( https://github.com/wch/R6/issues/36), I thought it's okay to go ahead and ask a bigger audience about their opinion/suggestions for a general solution and/or good workarounds: Actual questions 1. Shouldn't the fact

Re: [R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-16 Thread Janko Thyson
#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. On November 15, 2014 6:49:41 AM PST, Janko Thyson janko.thy...@gmail.com wrote

Re: [R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-16 Thread Janko Thyson
from my phone. Please excuse my brevity. On November 16, 2014 8:42:20 AM PST, Janko Thyson janko.thy...@gmail.com wrote: Thanks for the info/suggestions! But note that it's not just a one-step, but a two step dispatching process with respect to `...`. That is, `foo()` and `bar

Re: [R] Lexical scoping/calling stack issue: R fails to recognize an argument's default value

2014-11-15 Thread Janko Thyson
calling stack structure (spread across three different packages). Best regards and happy coding, Janko On Sat, Nov 15, 2014 at 2:06 AM, Janko Thyson janko.thy...@gmail.com wrote: Thanks. I will try to further simplify the example. On Sat, Nov 15, 2014 at 2:01 AM, Jeff Newmiller jdnew

[R] Fine controlling three dots argument dispatch to functions with identical argument names

2014-11-15 Thread Janko Thyson
Dear list, I wonder if there's a clever way to fine control the exact way arguments are dispatched via R's three dots argument Consider the following use case: - you have a function foobar() that calls foo() which in turn calls bar() - *both* foo() and bar() have an argument that's

[R] Lexical scoping/calling stack issue: R fails to recognize an argument's default value

2014-11-14 Thread Janko Thyson
Dear list, I just encountered a behavior that I've never seen before: Is it possible, that certain argument names (lazy in my case) are special/reserved and thus would lead to unexpected behavior when a calling stack is involved that spreads across functions of three different packages:

Re: [R] Lexical scoping/calling stack issue: R fails to recognize an argument's default value

2014-11-14 Thread Janko Thyson
) Thanks a lot should you take the time to look into this, Janko On Sat, Nov 15, 2014 at 1:13 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 14/11/2014, 6:51 PM, Janko Thyson wrote: Dear list, I just encountered a behavior that I've never seen before: Is it possible

Re: [R] Lexical scoping/calling stack issue: R fails to recognize an argument's default value

2014-11-14 Thread Janko Thyson
#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. On November 14, 2014 3:51:16 PM PST, Janko Thyson janko.thy...@gmail.com wrote: Dear list, I just

[R] S4 Reference Classes: undesired behavior when calling method '$field()'

2013-03-20 Thread Janko Thyson
Dear list, I came across a behavior that IMHO is somewhat undesired when calling '$field()': If the field name whose value you're trying to get is *not* a valid field of the Reference Class, then R doesn't stop there with an error, but scans through all enclosing environments/frames. The

[R] Appending BSON arrays in MongoDB with package 'rmongodb'

2013-01-24 Thread Janko Thyson
Dear list, I simply can't figure out how to append an BSON array in MongoDB (with package 'rmongodb') using either the '$push' or '$addToSet' operator. It's sort of the last missing puzzle piece regarding CRUD operations, so any hint will be greatly appreciated! Below you'll find a link to

[R] Workarounds to Rd file name conflict when extending a S4 method of some other package

2012-11-30 Thread Janko Thyson
Dear list, // IN SHORT // What are possible workarounds to consolidate documentation for S4 methods that are scattered across different packages (generic and some custom methods in one package, additional custom methods in another package) in a *single* Rd help file while using package

[R] Possible bug in class 'POSIXlt' when including microseconds?

2012-07-30 Thread Janko Thyson
Dear list, I'm a bit puzzled by an ambiguity with respect to the representation of micro-/milliseconds when using 'POSIXlt' objects. It seems that the last digit of the 'sec' attribute sometimes seems to differ from the digits shown when printing the 'POSIXlt' object. You'll find a little SO

[R] Feature request: 'file.path()' accepting an input vector

2012-06-28 Thread Janko Thyson
Dear list, I have a small feature request regarding the implementation of 'file.path()': It'd be great if 'file.path()' would allow to specify an input *vector* instead of solely rely on a specification via the three dot argument. AFAIU, currently it's only possible to manually specify

Re: [R] Feature request: 'file.path()' accepting an input vector

2012-06-28 Thread Janko Thyson
paths. On 28.06.2012 12:10, Prof Brian Ripley wrote: On 28/06/2012 10:40, Janko Thyson wrote: Dear list, I have a small feature request regarding the implementation of 'file.path()': Clearly you have not read where and how to make feature requests (R-devel list or Wishlist on bugs.r-project.org

[R] Bug with memory allocation when loading Rdata files iteratively?

2012-02-09 Thread Janko Thyson
Dear list, when iterating over a set of Rdata files that are loaded, analyzed and then removed from memory again, I experience a *significant* increase in an R process' memory consumption (killing the process eventually). It just seems like removing the object via |rm()| and firing |gc()| do

Re: [R] Update MS Windows PATH variable based on a R script

2011-12-08 Thread Janko Thyson
20:58, Duncan Murdoch wrote: On 29/06/2011 2:24 PM, Janko Thyson wrote: Dear list, this is not directly an R question, but it is somewhat related to R aspects, so I hope it's okay to post it here: I'd like to update my windows PATH based on a script routine in order to make sure that crucial

Re: [R] making changes to global variables in functions

2011-12-07 Thread Janko Thyson
. -- *Janko Thyson* janko.thy...@ku-eichstaett.de mailto:janko.thy...@ku-eichstaett.de Catholic University of Eichstätt-Ingolstadt Ingolstadt School of Management Statistics and Quantitative Methods Auf der Schanz 49 D-85049 Ingolstadt

Re: [R] nice report generator?

2011-12-07 Thread Janko Thyson
I like knitr. IMHO Yihui really came up with a killer package there: http://yihui.github.com/knitr/ On 07.12.2011 19:19, Sarah Goslee wrote: Sweave. Or ODFWeave, if Sweave/LaTeX are too much overhead. But really, it depends on what kind of report output you need to deliver. Printed? HTML?

[R] How to write (complex) coercion methods or what's the reason to limit 'setAs()' the way it is limited?

2011-12-04 Thread Janko Thyson
Dear list, I'd like to write coercion methods for some of my Reference Classes. However, using 'setAs()' is not a real option as its argument 'def' only allows for functions depending on one single argument. In some cases, that is simply too much of a limitation for me. And I don't really see

Re: [R] Why does loading saved/cached objects add significantly to RAM consumption?

2011-09-01 Thread Janko Thyson
On 30.08.2011 20:33, Henrik Bengtsson wrote: Hi. On Tue, Aug 30, 2011 at 3:59 AM, Janko Thyson janko.thyson.rst...@googlemail.com wrote: Dear list, I make use of cached objects extensively for time consuming computations and yesterday I happened to notice some very strange behavior

[R] Why does loading saved/cached objects add significantly to RAM consumption?

2011-08-30 Thread Janko Thyson
Dear list, I make use of cached objects extensively for time consuming computations and yesterday I happened to notice some very strange behavior in that respect: When I execute a given computation whose result I'd like to cache (tried both saving it as '.Rdata' and via package 'R.cache'

Re: [R] string manipulation

2011-08-26 Thread Janko Thyson
You might want to take a look at 'regexpr' and/or 'gregexpr': mytext - I want the number 2000, not the number two thousand idx - regexpr(\\d{4}, mytext) idx - c(idx, (idx + attributes(idx)$match.length)-1) substr(start=idx[1], stop=idx[2], mytext) HTH, Janko On 26.08.2011 03:51, Lorenzo

[R] Simple inheritance check fails (integer from numeric)

2011-07-07 Thread Janko Thyson
Dear list, In a function, I don't care if my input has class 'integer' or 'numeric', so I wanted to use 'inherits()' to control for that. However, this function tells me that an actual object of class 'integer' does not inherit from class 'numeric'. The class def of 'integer' does state

Re: [R] Simple inheritance check fails (integer from numeric)

2011-07-07 Thread Janko Thyson
On 07.07.2011 16:09, David Winsemius wrote: On Jul 7, 2011, at 6:01 AM, Janko Thyson wrote: Dear list, In a function, I don't care if my input has class 'integer' or 'numeric', so I wanted to use 'inherits()' to control for that. However, this function tells me that an actual object

Re: [R] Update MS Windows PATH variable based on a R script

2011-06-30 Thread Janko Thyson
On 29.06.2011 21:24, Duncan Murdoch wrote: On 29/06/2011 3:15 PM, Janko Thyson wrote: On 29.06.2011 20:58, Duncan Murdoch wrote: On 29/06/2011 2:24 PM, Janko Thyson wrote: Dear list, this is not directly an R question, but it is somewhat related to R aspects, so I hope it's okay to post

[R] Update MS Windows PATH variable based on a R script

2011-06-29 Thread Janko Thyson
Dear list, this is not directly an R question, but it is somewhat related to R aspects, so I hope it's okay to post it here: I'd like to update my windows PATH based on a script routine in order to make sure that crucial components are contained. Much like what happens at the installation

Re: [R] Update MS Windows PATH variable based on a R script

2011-06-29 Thread Janko Thyson
On 29.06.2011 20:58, Duncan Murdoch wrote: On 29/06/2011 2:24 PM, Janko Thyson wrote: Dear list, this is not directly an R question, but it is somewhat related to R aspects, so I hope it's okay to post it here: I'd like to update my windows PATH based on a script routine in order to make sure

[R] Reset R's library to base packages only (remove all installed contributed packages)

2011-06-14 Thread Janko Thyson
Dear list, is there a way to comfortably reset R's library such that it only contains only the base packages again? In other words, how can I uninstall all contributed packages that I installed? Is there some sort of index that's keeping track of what has been installed? If so, a pointer

Re: [R] Reset R's library to base packages only (remove all installed contributed packages)

2011-06-14 Thread Janko Thyson
On 14.06.2011 13:34, Uwe Ligges wrote: On 14.06.2011 12:04, Janko Thyson wrote: Dear list, is there a way to comfortably reset R's library such that it only contains only the base packages again? In other words, how can I uninstall all contributed packages that I installed? Is there some

[R] How can I write methods for 'as()'?

2011-06-06 Thread Janko Thyson
' as I did above? Thanks for your help, Janko -- *Janko Thyson* janko.thy...@googlemail.com mailto:janko.thy...@googlemail.com Jesuitenstraße 3 D-85049 Ingolstadt Mobile: +49 (0)176 83294257 This e-mail and any attachment

Re: [R] How can I write methods for 'as()'?

2011-06-06 Thread Janko Thyson
' but that didn't work out. Thanks a lot, Janko On 06.06.2011 17:15, Janko Thyson wrote: Dear list, I wonder how to write methods for the function 'as' in the sense that I can call 'as(object, Class, strict=TRUE, ext)' and let method dispatch figure out the correct method. AFAIU, there is a difference

Re: [R] How can I write methods for 'as()'?

2011-06-06 Thread Janko Thyson
, Janko Thyson wrote: Somehow I don't see my own postings in the list, so sorry for replying to my own message and not the one that went out to the list. I got a little further and I think I found exactly the thing that is bothering me: how to get extended method dispatch going in 'setAs

Re: [R] Is there a (virtual) class that all R objects inherit from?

2011-06-03 Thread Janko Thyson
On 31.05.2011 18:17, Martin Morgan wrote: On 05/30/2011 07:02 AM, Janko Thyson wrote: Dear list, I would like to set one specific Reference Class field to be of an arbitrary class. Is there a class that all R objects inherit from? I thought that ANY was something like this, but obviously

[R] Is there a (virtual) class that all R objects inherit from?

2011-05-30 Thread Janko Thyson
Dear list, I would like to set one specific Reference Class field to be of an arbitrary class. Is there a class that all R objects inherit from? I thought that ANY was something like this, but obviously that's not true: inherits(1:3, ANY) [1] FALSE Regards, Janko [[alternative HTML

[R] Remove duplicate elements in lists via recursive indexing

2011-05-23 Thread Janko Thyson
Dear list, I'm trying to solve something pretty basic here, but I can't really come up with a good solution. Basically, I would just like to remove duplicated named elements in lists via a their respective recursive indexes (given that I have a routine that identifies these recursive

Re: [R] Remove duplicate elements in lists via recursive indexing

2011-05-23 Thread Janko Thyson
) testData[firstCaseOnly,keep]=T } (testData = testData[testData$keep==T,]) On 23 May 2011, at 11:59 AM, Janko Thyson wrote: Dear list, I'm trying to solve something pretty basic here, but I can't really come up with a good solution. Basically, I would just like to remove duplicated named

Re: [R] Passing function arguments to dataset names

2011-05-23 Thread Janko Thyson
Hi Mateo, not sure if I totally get what you're after, but maybe this helps: SharpeRatio.annualized - function(roc){ print(I'm computing the Sharpe Ratio) return() } MyF - function(Tic, price){ print(Option 1) expr - expression(Ratio.Tic - SharpeRatio.annualized(roc))

Re: [R] identical function names from 2 packages

2011-05-20 Thread Janko Thyson
read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- *Janko Thyson* janko.thy...@ku-eichstaett.de mailto:janko.thy...@ku-eichstaett.de

Re: [R] identical function names from 2 packages

2011-05-20 Thread Janko Thyson
) : there is no package called 'testNS' I've looked into this briefly: ?asNamespace ?attachNamespace But there are no examples, so I don't really know how to use them ;-) Regards, Janko On 20.05.2011 10:45, Barry Rowlingson wrote: On Fri, May 20, 2011 at 9:16 AM, Janko Thyson janko.thyson.rst

[R] Flattening lists and environments (was: how to flatten a list to the same level?)

2011-05-19 Thread Janko Thyson
have one yet ;-) On 19.05.2011 22:16, Janko Thyson wrote: From: Mark Heckmann mark.heckmann_at_gmx.de mailto:mark.heckmann_at_gmx.de?Subject=Re:%20[R]%20how%20to%20flatten%20a%20list%20to%20the%20same%20level? Date: Sat, 09 Jan 2010 13:49:15 +0100 Henrique, thanks for the code!! It works

Re: [R] Remove all whitespaces

2011-05-05 Thread Janko Thyson
string. Anyone know a good way of doing this? //Joel -- *Janko Thyson* janko.thy...@googlemail.com mailto:janko.thy...@googlemail.com Jesuitenstraße 3 D-85049 Ingolstadt Mobile: +49 (0)176 83294257 This e-mail and any

[R] Tone in mailing lists (was issue with strange characters (readHTMLTable))

2011-05-05 Thread Janko Thyson
. -- *Janko Thyson* janko.thy...@googlemail.com mailto:janko.thy...@googlemail.com Jesuitenstraße 3 D-85049 Ingolstadt Mobile: +49 (0)176 83294257 This e-mail and any attachment is for authorized use by the intended

[R] Feature request: rating/review system for R packages

2011-03-20 Thread Janko Thyson
Dear List, I'm aware that this has been brought up before (e.g. http://tolstoy.newcastle.edu.au/R/e6/help/09/03/7365.html http://tolstoy.newcastle.edu.au/R/e6/help/09/03/7365.html ; https://stat.ethz.ch/pipermail/r-help/2009-March/190902.html

Re: [R] Referring to objects themselves

2011-03-19 Thread Janko Thyson
You might want to check out Reference Classes (?SetRefClass). The object itself is stored in '.self' and can be referenced that way. HTH, Janko -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Russ Abbott Gesendet: Samstag,

[R] Retrieve an index of nested lists | Changing name delimiter in 'unlist()'

2011-03-17 Thread Janko Thyson
Dear list, I have to problems that are connected: PROBLEM 1 I wonder if it is somehow possible to patch the function 'unlist(use.names=TRUE)' such that you can specify an arbitrary name delimiter, e.g. / or _. As I often name my variables var.x.y, the default delimiter makes it hard to

[R] WG: Reference classes: error with missing arguments in method calls

2011-03-06 Thread Janko Thyson
Dear list, a while ago I posted this at r-devel but got no answers. Hope it’s okay to give it a shot again by cross-posting it here. TIA for any comments, Janko Von: Janko Thyson [mailto:janko.thyson.rst...@googlemail.com] Gesendet: Montag, 21. Februar 2011 00:58 An: r-devel@r-project. org (r

[R] RCurl - HTTP request of header ONLY

2011-02-11 Thread Janko Thyson
Hi everyone, I'm trying to send an HTTP request using RCurl that only requests the response header, not the actual content. http://curl.haxx.se/docs/httpscripting.html says you can do this by using the following option: curl --head http://www.something.com/ However, I can't figure out how to do

Re: [R] How to catch error message

2010-11-26 Thread Janko Thyson
try.result - try(your.expr) if(inherits(try.result, try-error)){ do.what.needs.to.be.done.here() } else { cat(OK, sep=\n) } Or have a look at ?tryCatch Cheers, Janko -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im

[R] Possible to pretty-printing using str()?

2010-11-23 Thread Janko Thyson
Dear list, I'm looking for a suitable way to sort of one-line-pretty-print an arbitrary R object in some of my log outputs. Consider this: cat(paste(The object/value is: , x, ., sep=), sep=\n) No problem if x is of class: - character (length=1) - numeric (length=1) - logical

Re: [R] Possible to pretty-printing using str()?

2010-11-23 Thread Janko Thyson
as of 2010-11-22) Eclipse 3.6.1 (Helios) StatET 0.9.x ### -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Janko Thyson Gesendet: Dienstag, 23. November 2010 20:32 An: r-h...@r-project. org

Re: [R] Possible to pretty-printing using str()?

2010-11-23 Thread Janko Thyson
Aha: capture.output(str(x)) Sorry for the two previous eMails, but sometimes posting to the list helps me thinking somehow ;-) Greetz, Janko -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Janko Thyson Gesendet

Re: [R] How to get a specific named element in a nested list

2010-11-11 Thread Janko Thyson
What you want is some sort of indexing nested lists based on names (as we are used to for vectors, for example). As Ivan pointed out, I don't think there's an out-of-the-box function in R that supports such indexing as it requires some sort of mapping of the nested list's hierarchical structure.

[R] Problems building own package (Error: package has been build before R-2.10.0)

2010-08-17 Thread Janko Thyson
stated there is “C:\R\R-2.11.1\bin;”. - I updated the DESCRIPTION file and specified all .Rd files correctly. Any idea what I’m doing wrong? Thanks a ton, Janko _ Janko Thyson mailto:holger.ko...@ku-eichstaett.de janko.thy...@ku-eichstaett.de Catholic University

[R] RMySQL: Slower parsing over time with htmlTreeParse()

2010-03-15 Thread Janko Thyson
Dear List, has anyone of you experienced a significant increase in the time it takes to parse an URL via htmlTreeParse() when this function is called repeatedly every minute over a couple of hours? Initially, a single parse takes about 0.5 seconds on my machine (Quad Core, 2.67 GHz, 8 MB

[R] XML: Slower parsing over time with htmlTreeParse()

2010-03-15 Thread Janko Thyson
Sorry, I listed the wrong package in the header of my previous post! Dear List, has anyone of you experienced a significant increase in the time it takes to parse an URL via htmlTreeParse() when this function is called repeatedly every minute over a couple of hours? Initially, a

[R] Ubunut + Eclipse + StatET: Console terminates upon error

2010-03-11 Thread Janko Thyson
Dear List, I'm trying to set up Eclispe (3.5.1) with the StatET-Plugin (0.8.1) under Ubuntu (Karmic) and found it strange that my console terminates every time something in a script produces an arbitrary error (e.g. just calling a missing variable, trying to perform an illegal operation etc.).

Re: [R] Ubunut + Eclipse + StatET: Console terminates upon error

2010-03-11 Thread Janko Thyson
on? Thanks a lot! Janko -Ursprüngliche Nachricht- Von: Dirk Eddelbuettel [mailto:e...@debian.org] Gesendet: Donnerstag, 11. März 2010 19:40 An: Janko Thyson Cc: r-help@r-project.org; tobias.verb...@openanalytics.eu Betreff: Re: [R] Ubunut + Eclipse + StatET: Console terminates upon error

[R] Possible to save workspace image including packages and class definitions?

2010-02-18 Thread Janko Thyson
Hi everyone! Is it possible to save an image of the workspace where 1) Packages 2) Classes are saved along with the image? Until now I only managed to save an workspace image that contained all variables (including functions). When loading this image back into a new session,

[R] Using Rscript in combination with eval() results in error

2010-02-11 Thread Janko Thyson
Dear List, I'm having trouble running a .bat file which calls an R-Script via the command line (using Rscript). I put the following line in a file called test.bat: Rscript --vanilla test.R Then I tried to launch test.bat via Windows' CMD (I plan to make this a scheduled Windows task). The

Re: [R] Can an object reference itself?

2010-01-18 Thread Janko Thyson
Thyson Cc: r-help@r-project.org Betreff: Re: [R] Can an object reference itself? On Fri, Jan 15, 2010 at 5:30 PM, Janko Thyson janko.thy...@ku-eichstaett.de wrote: Dear List, I am not really familiar with any other language than R, but I’ve heard that in other languages

[R] Can an object reference itself?

2010-01-15 Thread Janko Thyson
- C:/obj.2.for.slot.Rdata t...@data(obj.name=test) test@data(obj.name=test.mod) I'm trying to have slotfun() be stated in a way that does not require an explicit stating of argument obj.name): t...@data() test@data() Any hints in the right directions greatly appreciated! Regards, Janko

[R] Function nsl() missing in package utils

2009-08-21 Thread Janko Thyson
). I've tried the R-versions 2.8.1, 2.9.0 and 2.9.1. I'd be very thankful if someone could give me a hint on nsl or some other function to do a hostname lookup! Regards, Janko Thyson Janko Thyson janko.thy...@kuei.de Catholic University of Eichstätt-Ingolstadt Ingolstadt School of Management