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 >> https://github.com/hadley/lubridate/issues/5

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
On Thu, Jan 12, 2017 at 8:37 PM, David Winsemius wrote: > >> On Jan 12, 2017, at 8:14 AM, Janko Thyson wrote: >> >> Dear list, >> >> I'm experiencing problems with converting strings of the format >> "-" (e.g. 2016-01, 2016-52) to proper PO

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

2017-01-12 Thread Janko Thyson
es: [1] fva_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.2wit

[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
. Go Live... > DCN:Basics: ##.#. ##.#. Live > Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. r

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

2014-11-16 Thread Janko Thyson
Basics: ##.#. ##.#. Live > Go... > > Live: OO#.. Dead: OO#.. Playing > > Research Engineer (Solar/BatteriesO.O#. #.O#. with > > /Software/Embedded Controllers) .OO#. .OO#. > rock

[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

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

2014-11-15 Thread Janko Thyson
g-stack-issue-r-fails-to-recognize-an-arguments-defaul Thanks for everyone that answered/took the time to have a look at the code - and sorry for having thrown a complicated example at you! It was just that at first I didn't see the wood for the trees and I thought that the problem was caused

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

2014-11-14 Thread Janko Thyson
> Research Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --- > Sent from my phone. Please excuse my brevity. > > On Novembe

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

2014-11-14 Thread Janko Thyson
(id = "x_2", value = reactr::reactiveExpression( !getAnywhereOption(id = "x_1") ), reactive = TRUE) getAnywhereOption(id = "x_1") getAnywhereOption(id = "x_2") Thanks a lot should you take the time to look into this, Janko On Sat, Nov 15, 2014 at 1:1

[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: optionr::

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

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

[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 'roxy

[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

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

2012-06-28 Thread Janko Thyson
recommends *not* using 'paste()' for putting together file 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

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

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

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

2011-12-08 Thread Janko Thyson
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 ma

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? PDF

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

2011-12-07 Thread Janko Thyson
___ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >

[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 wrote: 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

[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' which

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

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 functio

[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 'num

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 po

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

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

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

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

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

2011-06-06 Thread Janko Thyson
uot;) b$X I'm sure there are much better ways. I'd appreciate any comments whatsoever. Best regards, Janko On 06.06.2011 17:46, 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

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

2011-06-06 Thread Janko Thyson
from 'A', shouldn't it then be possible to tell 'setAs' to look for the next suitable method, i.e. the method defined for 'A'? I tried 'NextMethod()' inside the body of 'setAs' but that didn't work out. Thanks a lot, Janko On 06.06.

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

2011-06-06 Thread Janko Thyson
ne something like 'as.data.frame.character' in order to have explicit "sub" methods for all the data types of 'x' so I wouldn't have to process them all in the definition of 'as.myClass' as I did above? Thanks for your help, Janko -- --

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 &

[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

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(ro

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

2011-05-23 Thread Janko Thyson
(testData$Var1) for(thisID in uniqueIDS) { firstCaseOnly = match(thisID,testData$Var1) 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 her

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

Re: [R] identical function names from 2 packages

2011-05-20 Thread Janko Thyson
tNS") Fehler in loadNamespace(name) : 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

Re: [R] identical function names from 2 packages

2011-05-20 Thread Janko Thyson
when doing the top level analysis. >> >> If there is a resolution to this, I'll be happy. >> >> Cheers, Jari Oksanen >> >> __ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinf

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

2011-05-19 Thread Janko Thyson
nko PS: Maybe this should rather go into a blog-post, but I don't have one yet ;-) On 19.05.2011 22:16, Janko Thyson wrote: From: Mark Heckmann <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:4

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

2011-05-05 Thread Janko Thyson
nted, minimal, self-contained, reproducible code. > > > -- > Brian D. Ripley,rip...@stats.ox.ac.uk > Professor of Applied Statistics, [4]http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (P

Re: [R] Remove all whitespaces

2011-05-05 Thread Janko Thyson
t; Hi >> >> I got a string that looks something like this >> >> 1 2 3 4 5 6 7 8 9 ... >> >> and I want it to be >> >> 123456789... >> >> So I want to remove all spaces (or whitespaces) from my string. >> >> Anyone know a good

[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 ; https://stat.ethz.ch/pipermail/r-help/2009-March

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

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

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

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 &

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

2010-11-23 Thread Janko Thyson
2.0 (patched 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

[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] 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 Univ

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

[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

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

2010-03-11 Thread Janko Thyson
ome//R/i486-pc-linux-gnu-library/2.10/rJava’ The downloaded packages are in ‘/tmp/RtmpbGKuzS/downloaded_packages’ Warning message: In install.packages("rJava", repos = repos.cran, lib = "/home//R/i486-pc-linux-gnu-library/2.10") : installation of package '

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

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

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

Re: [R] Can an object reference itself?

2010-01-18 Thread Janko Thyson
source the method for "initialize()" and to reassign "obj" each time. Regards, Janko > -Ursprüngliche Nachricht- > Von: hadley wickham [mailto:h.wick...@gmail.com] > Gesendet: Freitag, 15. Januar 2010 19:35 > An: Janko Thyson > Cc: r-help@r-project.org &

[R] Can an object reference itself?

2010-01-15 Thread Janko Thyson
") 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 Thyson janko.thy...@kuei.de Catholic Un

[R] Function "nsl()" missing in package utils

2009-08-21 Thread Janko Thyson
allation(s). 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 I