> While
> package names are not functions, using dots in package names
> encourages the use of dots in functions, a dangerous practice.
"dangerous"...?
I can't understand the necessity of RStudio and Tiny-Verse affiliated
persons to repeatedly use subjective and unscientific phrasing.
Elegant, Ad
Using a non-capturing group, "(?:...)" instead of "(...)", simplifies my
example a bit
> x <- c("Groucho ", "", "Harpo")
> strcapture("([[:alpha:]]+)?(?: *<([[:alpha:]. ]+@[[:alpha:]. ]+)>)?", x,
proto=data.frame(Name=character(), Address=character(),
stringsAsFactors=FALSE))
Name Ad
I don't care much for regmatches and haven't tried strextract, but I think
replacing the character(0) by NA_character_ is almost always inappropriate
if the match information comes from gregexpr.
I think strcapture() does a pretty good job of what I think you are trying
to do. Perhaps adding an a
I do think keeping the default behavior is desirable for backwards
compatibility; my suggestion is not to change default behavior but to add an
optional argument that allows a different behavior. Although this can be
implemented in a user-defined function, retaining empty matches facilitates
pr
While poking around the C++ code in the dplyr package I ran across the idiom
Rf_defineVar(symbol, R_UnboundValue, environment)
to [sort of] remove 'symbol' from 'environment'
Using it makes the R-level functions objects(), exists(), and get()
somewhat inconsistent and I was wondering if that wa
Changing the default behavior of regmatches would break its use with
gregexpr, where
the number of matches per input element faries, so a zero-length character
vector
makes more sense than NA_character_.
> x <- c("John Doe", "e e cummings", "Juan de la Madrid")
> m <- gregexpr("[A-Z]", x)
> regmat
Martin,
Thank you for discussing this amongst R-core and for detailing the
R-core discussion here.
Some specific examples where having underscores available would have
been useful.
1. My primerTree package (2013) was originally primer_tree, but I had
to change the name to camelCase to comply wit
A very common use case for regmatches is to extract regex matches into a new
column in a data.frame (or data.table, etc.) or otherwise use the extracted
strings alongside the input. However, the default behavior is to drop empty
matches, which results in mismatches in column length if reassignme