Displaying 20 results from an estimated 10000 matches similar to: "pmatch inconsistency"
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("m", c("mean",
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
2011 Oct 18
1
Function to "lump" factors together?
Sorry about the odd terminology, but I suspect that my intent might be
completely missed had I used "aggregate" or "classify" (each of which
appears to have some rather special meanings in statistical analysis and
modeling).
I have some data about software builds; one of the characteristics of
each is the name of the branch.
A colleague has generated some fairly interesting
2023 Dec 16
2
Partial matching performance in data frame rownames using [
On Wed, 13 Dec 2023 09:04:18 +0100
Hilmar Berger via R-devel <r-devel at r-project.org> wrote:
> Still, I feel that default partial matching cripples the functionality
> of data.frame for larger tables.
Changing the default now would require a long deprecation cycle to give
everyone who uses `[.data.frame` and relies on partial matching
(whether they know it or not) enough time to
2023 Dec 19
1
Partial matching performance in data frame rownames using [
Hi Hilmar and Ivan,
I have used your code examples to write a blog post about this topic,
which has figures that show the asymptotic time 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).
2010 Nov 09
1
agrep pmatch recursive???
Hello R Helpers,
Business - 64 bit windows 7, R 2.11.1
I am trying to match the character contents of one list, called 'exclude', to those of a second list, called 'dataset'
dataset is a list of file names with folder locations, and looks like this when called:
> dataset
[1] "A/10-10-29a-13.cdf" "A/10-10-29a-14.cdf" "A/10-10-29a-15.cdf"
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
2009 Oct 30
1
bug in `pmatch' (error with too long 'choices')?
I observed the 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
2004 Nov 02
1
install.packages, bundles, pmatch, and Rprofile...
Hi,
Somebody asked me to make sure that all the machines running the in our lab
(XP and Linux, both running 2.0) have R installed and that A) All the
packages are installed and B) kept up-to-date.
Obediently, I began to modify a shared Rprofile so that once a week it
checks for new packages and updates to the current version of the installed
packages on CRAN. Sounds simple enough. Plus some
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
2010 Jul 13
1
StartsWith over vector of Strings?
Given vectors of strings of arbitrary length
content <- c("abc", "def")
searchset <- c("a", "abc", "abcdef", "d", "def", "defghi")
Is it possible to determine the content String set that matches the
searchset in the sense of 'startswith' ? This would be a vector of all
strings in content that start with
2008 Jul 01
1
[.data.frame speedup
Below is a version of [.data.frame that is faster
for subscripting rows of large data frames; it avoids calling
duplicated(rows)
if there is no need to check for duplicate row names, when:
i is logical
attr(x, "dup.row.names") is not NULL (S+ compatibility)
i is numeric and negative
i is strictly increasing
"[.data.frame" <-
function (x, i, j,
2010 Aug 09
1
Smart Indexing
Hi all,
Suppose that I've two data frames, a and b say, both containing a column
'id'. While data frame 'a' contains multiple rows sharing the same id,
data frame 'b' contains just one entry per id (i.e. a 1 to n
relationship). For the ease of modeling I now want to generate a new
data frame c, which is basically a copy of data frame 'a' augmented by
the values
2003 Sep 24
1
partial matching in data frame subscripting
I'm not sure if the following is a bug or a feature:
> jjmat <- array(1:6, c(2,3), list(c('ABC', 'DEF'), c('xyz', 'tuv',
'qrs')))
> jjdf <- as.data.frame(jjmat)
> jjmat['AB', ]
Error: subscript out of bounds
> jjdf['AB',]
xyz tuv qrs
ABC 1 3 5
> jjmat[, 'tu']
Error: subscript out of bounds
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()
2003 Oct 20
3
'optim' and extra argument to the objective function
Hello,
I'd like to use optim, and give extra arguments to the objective
function. The man page says that the '...' should let one do it,
but I have a hard time to understand how.
Example:
x <- 1:10
y <- rnorm(10)
cost.f <- function(par, x, y) {
A <- par[1]
cost <- sum( (log(A*x) - log(y))^2)
return(cost)
}
optim(3, cost.f, x, y)
## returns:
Error in pmatch(x,
2019 Feb 03
1
Inefficiency in df$col
While doing some performance testing with the new version of pqR (see
pqR-project.org), I've encountered an extreme, and quite unnecessary,
inefficiency in the current R Core implementation of R, which I think
you might want to correct.
The inefficiency is in access to columns of a data frame, as in
expressions such as df$col[i], which I think are very common (the
alternatives of
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 =
2014 Jun 17
1
rJava Java debugger API
Hi,
I use rJava and call Java code that uses JVMTI code like this
VM vm = VM.getVM();
Universe universe = vm.getUniverse();
CollectedHeap heap = universe.heap();
This code attaches to another JVM and to get its internals. This is legal
Java and it works. But when I use rJava to call this code, the call is
successfull and it throws an error. I believe there is Java
2009 Dec 19
3
integer(0) and NA do not equal FALSE
Hi,
A noobie question: I'm simply trying to run a conditional statement that
evaluates if a substring is found within a larger string. I find that if it
IS found, my function returns 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