Displaying 20 results from an estimated 154 matches for "pmatch".
Did you mean:
patch
2013 Jul 15
1
pmatch inconsistency
The pmatch help (see also section 4.3.2 in the R Language Definition)
claims that pmatch with duplicates.ok=FALSE provides the same
functionality as R's argument matching algorithm, modulo how empty
strings are matched.
Here's an undocumented inconsistency between pmatch and R's argument
matching...
2023 Dec 16
2
Partial matching performance in data frame rownames using [
...precation cycle to give
everyone who uses `[.data.frame` and relies on partial matching
(whether they know it or not) enough time to adjust.
Still, adding an argument feels like a small change: edit
https://svn.r-project.org/R/trunk/src/library/base/R/dataframe.R and
add a condition before calling pmatch(). Adjust the warning() for named
arguments. Don't forget to document the new argument in the man page at
https://svn.r-project.org/R/trunk/src/library/base/man/Extract.data.frame.Rd
Index: src/library/base/R/dataframe.R
===================================================================
--- s...
2008 Jun 23
3
One-to-one matching?
Hi folks,
Can anyone suggest an efficient way to do "matching without
replacement", or "one-to-one matching"? pmatch() doesn't quite provide
what I need...
For example,
lookupTable <- c("a","b","c","d","e","f")
matchSample <- c("a","a","b","d")
##Normal match() behaviour:
match(matchSample,lookupTable)...
1999 May 25
1
Muliple partial matches with pmatch
I am using R0.64.1 under Windows 95.
The help for `pmatch' states that:
If `duplicates.ok' is false multiple matches will result
in the value of `nomatch' being returned, and if it is
true, the index of the first matching value will be
returned.
The help for pmatch gives the following examples:
pmatch...
2023 Dec 19
1
Partial matching performance in data frame rownames using [
...ime complexity of the
various approaches,
https://tdhock.github.io/blog/2023/df-partial-match/
The asymptotic complexity of partial matching appears to be quadratic
O(N^2) whereas the other approaches are asymptotically faster: linear
O(N) or log-linear O(N log N).
I think that accepting Ivan's pmatch.rows patch would add un-necessary
complexity to base R, since base R already provides an efficient
work-around, d1[match(q1,rownames(d1)),]
I do think the CheckUserInterrupt patch is a good idea, though.
Best,
Toby
On Sat, Dec 16, 2023 at 2:49?AM Ivan Krylov <krylov.r00t at gmail.com> wrote:...
2023 Dec 13
1
Partial matching performance in data frame rownames using [
Dear Ivan,
thanks a lot, that is helpful.
Still, I feel that default partial matching cripples the functionality
of data.frame for larger tables.
Thanks again and best regards
Hilmar
On 12.12.23 13:55, Ivan Krylov wrote:
> ? Mon, 11 Dec 2023 21:11:48 +0100
> Hilmar Berger via R-devel <r-devel at r-project.org> ?????:
>
>> What was unexpected is that in this case was that
2009 Dec 19
3
integer(0) and NA do not equal FALSE
...TRUE (great!), but if not, the condition does
not evaluate to FALSE.
ex):
if( grep("hi", "hop", fixed = TRUE) )
print('yes, your substring is in your string')
else print('no, your substring is not in your string')
alternatively, I could replace grep with pmatch:
if (pmatch('hi','hop'))
print('yes, your substring is in your string')
else print('no, your substring is not in your string')
The first example, using grep, returns logical(0). The second, using
pmatch, returns NA. Any idea how to convert either of those...
2009 Aug 30
0
[LLVMdev] Regular Expression lib support
On Aug 28, 2009, at 1:53 AM, Daniel Dunbar wrote:
> Nice!
>
> This looks good to me but probably Chris or someone else should sign
> off on it.
This seems ok to me, please commit. One minor comment:
+++ b/lib/Support/Regex.cpp
+ // Allocate pmatch with at least one element.
+ pmatch = new llvm_regmatch_t[nmatch > 0 ? nmatch : 1];
+ pmatch[0].rm_so = 0;
+ pmatch[0].rm_eo = String.size();
Can this be a smallvector to avoid a heap allocation on every match?
-Chris
2000 Oct 23
1
Regular Expression and Pmatch
Hi, I wonder if there's a good intro to the pattern matching using R? I'm a perl
programer and find it too confusing and complex to use regular expressions under R.
For instance, why does pmatch("d","ad") returns NULL? How would I call the
functions in order to match any portion of the string? Under what circumstances shall
backslush be used? I try to extract all strings with ".d", however just couldnt manage
to do it? Any ideas? Or I have to write my own rege...
2010 Nov 09
1
agrep pmatch recursive???
...a-13", dataset, value=TRUE, max.distance=0)
[1] "B/10-10-29a-13.cdf"
However, I don't want to do this manually for each file on the exclude list - I want to do so for each character string on the
exclude list. I am not aware of any list options in agrep specifically, and while pmatch takes a list of a match option, it
will not successfully match the partial string:
> pmatch(exclude[,], dataset)
[1] NA NA NA NA
I am still in the process of teaching myself R, so maybe there is something I am missing. I also tried to figure out how to
use the recursive apply functionality,...
2009 Oct 30
1
bug in `pmatch' (error with too long 'choices')?
...following:
match.arg("white", colors())
yields 'white', but
match.arg("whit", colors())
yields:
`Error in match.arg("whit", colors()) :
'arg' should be one of "white", "aliceblue", '...
this message actually comes from `pmatch'. using a suitable subset of
`colors()' works OK. the precise length were the error occurs seems to
depend on `arg' and `choices'. e.g.
match.arg("whit", colors()[1:650])
works
but the limit seems not be fixed. in another setting it
happend around a length of `choices...
2004 Nov 02
1
install.packages, bundles, pmatch, and Rprofile...
...nstall.packages(missingPackages)
Now this might be trivial, but, missingPackages includes bundled packages
which are already installed (e.g., dse, VR) in addition to those packages
that are truly missing. I know I have to match myPackages with the Contains
column in CRANsPackages and probably use pmatch to do it, but the syntax
eludes me.
So, an example:
# Install a bundled package
install.packages("gregmisc")
# Get the installed package matrix
myPackages <- installed.packages()
# See if gregmisc is really there
myPackages[grep("gregmisc", myPackages[,5]),]
# Get the m...
2009 Aug 28
3
[LLVMdev] Regular Expression lib support
...r always fails to match.
>>>>> + // unless regex was compiled with NEWLINE flag.
>>>>> +
>>>>> + bool matches(const char *string, bool notbol=false, bool noteol=false);
>>>>> + bool match_sub(const char *string, llvm_regmatch_t pmatch[],
>>>>> + unsigned nmatch, bool notbol=false, bool noteol=false);
>>>>>
>>>>>
>>>> These should be doxymented, and I don't understand the flags. Does this mean
>>>> that if I *don't* compile with NEWLINE...
2010 May 19
3
Strange case of partial matching in .[ - possible bug / wrong documentation?
Hi all,
This occurred in R-2.11.0 (WinXP).
The R-help page of .[ says that:
"Character indices can in some circumstances be partially matched (see
pmatch) to the names or dimnames of the object being subsetted (but never
for subassignment). Unlike S (Becker et al p. 358)), R has never used
partial matching when extracting by [, and as from R 2.7.0 partial matching
is not by default used by [[ (see argument exact)."
My understanding is therefor...
2006 Mar 07
3
Expanding partial names
...> wrapper(longname = 3)
longname = 3
But it fails if I try to use partial argument matching:
> wrapper(long=4)
Error in lowlevel(longname = 2, long = 4) :
unused argument(s) (long ...)
because long isn't matched to longname. Is there a reasonable way to do
this (e.g. using pmatch or charmatch) other than listing all the low
level arguments in the argument list to wrapper?
Duncan Murdoch
2000 Feb 09
2
Row subsetting of data frames (PR#425)
If you want to use row names to take a row subset of a data.frame then
there is a bug when
- One row has a name which is a completion of another row name
- The shorter name comes after the longer one
- You want to retrieve the row with the shorter name
An example:
R> x <- matrix(1:4, 2, 2, dimnames=list(c("abc","ab"), c("cde","cd")))
R> x
cde
2009 Aug 30
1
[LLVMdev] Regular Expression lib support
...n Windows, the
msvc buildbot was all red before my commit, failing here:
G:\public\zorg\buildbot\osuosl\slave\clang-i686-xp-msvc9\llvm\include\llvm/Support/IRBuilder.h(133) : error C3861: 'InsertHelper': identifier not found
>
> +++ b/lib/Support/Regex.cpp
>
> + // Allocate pmatch with at least one element.
> + pmatch = new llvm_regmatch_t[nmatch > 0 ? nmatch : 1];
> + pmatch[0].rm_so = 0;
> + pmatch[0].rm_eo = String.size();
>
> Can this be a smallvector to avoid a heap allocation on every match?
Yes, I changed it to use SmallVector.
Best regards,
--E...
2005 Jan 19
1
* creating vignettes ... ERROR
Hi,
I have the following error when building a package
* creating vignettes ... ERROR
Error: chunk 3
Error in pmatch(x, table, duplicates.ok) :
argument is not of mode character
Error in buildVignettes(dir = ".") : Error: chunk 3
Error in pmatch(x, table, duplicates.ok) :
argument is not of mode character
Execution halted
I use R-2.0.1 under debian linux 2.6.9
Thanks for any idea
P...
2007 Sep 02
1
buglet in dist() ?
the first line of dist() says
if (!is.na(pmatch(method, "euclidian")))
shouldn't that be "euclidean" ?
---------------------
R version 2.5.1 (2007-06-27)
i486-pc-linux-gnu
locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_U...
2003 Aug 26
3
matching-case sensitivity
Hi All,
I am trying to match two character arrays (email lists) using either
pmatch(), match() or charmatch() functions. However the function is
"missing" some matches due to differences in the cases of some letters
between the two arrays. Is there any way to disable case sensitivity or is
there an entirely better way to match two character arrays that have
identical ent...