> 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,
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
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
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
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
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)
>
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
Just a reminder/confirmation that this is happening today (August 15th) at
09:00 PDT/ 12:00 EDT / 18:00 CEST using BlueJeans and can be joined via:
https://bluejeans.com/136043474?src=join_info (Meeting ID: 136 043 474)
The call should last no more than one hour.
We also have a slack channel
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