Re: [Rd] error handling in strcapture

2016-10-04 Thread Michael Lawrence
Once again, nice catch. I've committed a check for this. Michael On Tue, Oct 4, 2016 at 2:37 PM, William Dunlap wrote: > It is also not catching the cases where the number of capture expressions > does not match the number of entries in proto. I think all of the following > should give an error

Re: [Rd] On implementing zero-overhead code reuse

2016-10-04 Thread Kynn Jones
@Konrad, you're right, that's exactly what I'm looking for. That's great stuff. Thanks! (And thanks also to Gabor Grothendieck, who suggested modules to me way back.) On Tue, Oct 4, 2016 at 7:07 AM, Konrad Rudolph wrote: > Check out ‹klmr/modules› on Github (distinct from CRAN’s ‹modules›!).

Re: [Rd] error handling in strcapture

2016-10-04 Thread William Dunlap via R-devel
It is also not catching the cases where the number of capture expressions does not match the number of entries in proto. I think all of the following should give an error about the mismatch. > strcapture("(.)(.)", c("ab", "cde", "fgh", "ij", "lm"), proto=list(A="",B="",C="")) A B C 1 a b c

Re: [Rd] error handling in strcapture

2016-10-04 Thread Michael Lawrence
Hi Bill, This is a bug in regexec() and I will commit a fix. Thanks for the report, Michael On Tue, Oct 4, 2016 at 1:40 PM, William Dunlap wrote: > I noticed a problem in the strcapture from R-devel (2016-09-27 r71386), when > the text contains a missing value and perl=TRUE. > > { > # NA

Re: [Rd] error handling in strcapture

2016-10-04 Thread William Dunlap via R-devel
I noticed a problem in the strcapture from R-devel (2016-09-27 r71386), when the text contains a missing value and perl=TRUE. { # NA in text input should map to row of NA's in output, without warning r9p <- strcapture(perl = TRUE, "(.).* ([[:digit:]]+)", c("One 1", NA, "Fifty 50"), dat

Re: [Rd] suggested addition to model.matrix

2016-10-04 Thread William Dunlap via R-devel
In addition, there is a formula method for data.frame that assumes the first column is the dependent variable. > z <- data.frame(X1=1:6,X2=letters[1:3],Y=log(1:6)) > formula(z) X1 ~ X2 + Y > colnames(model.matrix(formula(z), z)) [1] "(Intercept)" "X2b" "X2c" "Y" Spencer's requ

Re: [Rd] On implementing zero-overhead code reuse

2016-10-04 Thread elijah wright
Shower thoughts: Are you digging for something like what you'd use with a CI/CD pipeline? e.g. - building a workflow that pulls a tag from a couple of code repositories, checks them out into a workspace, installs prereqs, and then runs your code/tasks in a repeatable fashion? I'm not aware of a

Re: [Rd] On implementing zero-overhead code reuse

2016-10-04 Thread Konrad Rudolph
Check out ‹klmr/modules› on Github (distinct from CRAN’s ‹modules›!). It looks pretty much exactly like what you want: https://github.com/klmr/modules It has an extensive README and vignette explaining the usage. Cheers, Konrad -- Konrad Rudolph On Sun, 2 Oct 2016 at 18:31 Kynn Jones wrote: