Displaying 20 results from an estimated 6000 matches similar to: "pmax and long vector"
2019 Jan 21
2
pmax and long vector
Kasper,
If you're not interested or dont have time to create said patch yourself
let me know and i can do it.
Best,
~G
On Mon, Jan 21, 2019, 11:36 AM Duncan Murdoch <murdoch.duncan at gmail.com
wrote:
> On 21/01/2019 12:35 p.m., Kasper Daniel Hansen wrote:
> > I see that base::pmax() does not support long vectors.
> >
> > Is R-devel interested in reports like this;
2019 Jan 22
0
pmax and long vector
Gabe, I don't (yet) know much about long vectors at the C level. So feel
free to address this.
Duncan, I'll see what I can do regarding systematically compiling a list of
functions without long vector support. These days I frequently work with
big enough matrices that I need it.
On Mon, Jan 21, 2019 at 3:09 PM Gabriel Becker <gabembecker at gmail.com>
wrote:
> Kasper,
>
>
2019 Jan 21
0
pmax and long vector
On 21/01/2019 12:35 p.m., Kasper Daniel Hansen wrote:
> I see that base::pmax() does not support long vectors.
>
> Is R-devel interested in reports like this; ie. is there a goal of full
> support for long vectors in "basic" functions, something I at least would
> greatly appreciate?
>
> MRE:
>
>> pmax(rep(1L, 3*10^9), 0)
>
> Error in pmax(rep(1L,
2015 Dec 24
2
override pmin/pmax for my own matrix
Hello,
I'm trying to override pmin and pmax for my own matrix. These two
functions have ... as an argument. I tried to override them as
follows:
setMethod("pmax", class_name, function(x, ..., na.rm) { ... })
I use this way to override primitive functions such as min/max and it
works fine.
But it doesn't work for pmin and pmax. I guess because they are
regular functions?
How
2003 Jan 31
2
minor error in documentation of pmax in base (PR#2513)
The documentation says, "pmax and pmin take several vectors as
arguments and return a single vector giving the parallel maxima
(or minima) of the vectors."
I discovered that, if you use a matrix or array instead of a
vector, pmax returns a matrix or array, respectively.
This makes pmax and pmin much more useful, and should not be left
to people to discover on their own!
For example:
2018 Jan 20
1
max and pmax of NA and NaN
Extremes.Rd, that documents 'max' and 'pmax', has this in "Details" section, in the paragraph before the last.
By definition the min/max of a numeric vector containing an NaN is NaN, except that the min/max of any vector containing an NA is NA even if it also contains an NaN.
------------------
>>>>> Michal Burda <michal.burda at centrum.cz>
2012 Oct 30
4
There is pmin and pmax each taking na.rm, how about psum?
Hi,
Please consider the following :
x = c(1,3,NA,5)
y = c(2,NA,4,1)
min(x,y,na.rm=TRUE) # ok
[1] 1
max(x,y,na.rm=TRUE) # ok
[1] 5
sum(x,y,na.rm=TRUE) # ok
[1] 16
pmin(x,y,na.rm=TRUE) # ok
[1] 1 3 4 1
pmax(x,y,na.rm=TRUE) # ok
[1] 2 3 4 5
psum(x,y,na.rm=TRUE)
[1] 3 3 4 6 # expected result
Error: could not find function "psum" # actual result
2018 Jan 15
1
max and pmax of NA and NaN
Dear R users,
is the following OK?
> max(NA, NaN)
[1] NA
> max(NaN, NA)
[1] NA
> pmax(NaN, NA)
[1] NA
> pmax(NA, NaN)
[1] NaN
...or is it a bug? Documentation says that NA has a higher priority over
NaN.
Best regards, Michal Burda
[[alternative HTML version deleted]]
2012 Feb 09
1
Apply pmax to dataframe with different args based on dataframe factor
# I have a dataframe in the following form:
track <- c(rep('A', 3), rep('B', 4), rep('C', 4))
value <- c(0.15, 0.25, 0.35, 0.05, 0.99, 0.32, 0.13, 0.80, 0.75, 0.60, 0.44)
df <- data.frame(track=factor(track), value=value)
#> print(df)
#track value
#1 A 0.15
#2 A 0.25
#3 A 0.35
#4 B 0.05
#5 B 0.99
#6 B 0.32
#7 B 0.13
2019 Feb 27
2
Intermittent crashes with inset `[<-` command
Valgrind (without gctorture) reports memory misuse:
% R --debugger=valgrind --debugger-args="--leak-check=full --num-callers=18"
...
> x <- 1:200000
> y <- rep(letters[1:5], length(x) / 5L)
> for (i in 1:1000) {
+ # x[y == 'a'] <- x[y == 'b']
+ x <- `[<-`(x, y == 'a', x[y == 'b'])
+ cat(i, '')
+ }
1 2 3 4 5 6 7 8 9 10
2018 Feb 14
2
long vectors not supported yet
Hi,
I am running R 3.3.3 and getting the following error:
Error in add_edges(res, edges = t(as.matrix(el[, 1:2])), attr = weight) :
long vectors not supported yet: ../../src/include/Rinlinedfuns.h:138
when passing a 13 GB TransitionLayer object to shortestPath from the
package 'gdistance'.
The error, albeit in a different context, is discussed here:
2010 Feb 24
1
build, data and vignettes
Based on some testing it seems to me that if I have a package with
a dataset in /data
a Sweave vignette in inst/doc (but no associated pdf file)
the vignette loads the data in /data through
data(dataset)
and I do a
R CMD build
R will try to build the pdf version of the vignette, but will be
unable to find the dataset in data because the package is not yet
installed. However, if I do
2005 Dec 20
0
pmin(), pmax() - slower than necessary for common cases
A few hours ago, I was making a small point on the R-SIG-robust
mailing list on the point that ifelse() was not too efficient
in a situation where pmax() could easily be used instead.
However, this has reminded me of some timing experiments that I
did 13 years ago with S-plus -- where I found that pmin() /
pmax() were really relatively slow for the most common case
where they are used with only
2006 May 30
1
max / pmax
Hello R users,
I am relatively new to R and cannot seem to crack a coding problem. I
am working with substance abuse data, and I have a variable called
"primary.drug" which is considered the drug of choice for each
subject. I have just a few missing values on that variable. Instead
of using a multiple imputation method like chained equations, I would
prefer to derive these
2015 Dec 24
0
override pmin/pmax for my own matrix
Yes, functions like c, min and max are special cases, as they are
primitives. For ordinary functions, you just need to promote them with
"..." as the signature:
setGeneric("pmax", signature="...")
setMethod("pmax", "Class", function(..., na.rm=FALSE) { })
One caveat is that all arguments passed via "..." must derive from the
class
2018 Feb 14
0
long vectors not supported yet
This looks to me like a package development issue... which may be under discussion in R-sig-geo (search the archives), but more likely to be appropriate to discuss with the maintainer by email or through their development repository (R-forge, though it looks unused).
--
Sent from my phone. Please excuse my brevity.
On February 14, 2018 7:43:51 AM PST, Loris Bennett <loris.bennett at
2018 Feb 15
1
long vectors not supported yet
Hi Jeff,
Jeff Newmiller <jdnewmil at dcn.davis.ca.us> writes:
>> Hi,
>>
>> I am running R 3.3.3 and getting the following error:
>>
>> Error in add_edges(res, edges = t(as.matrix(el[, 1:2])), attr = weight)
>> :
>> long vectors not supported yet: ../../src/include/Rinlinedfuns.h:138
>>
>> when passing a 13 GB TransitionLayer
2024 Jul 16
2
Automatic Knot selection in Piecewise linear splines
>>>>> Anupam Tyagi
>>>>> on Tue, 9 Jul 2024 16:16:43 +0530 writes:
> How can I do automatic knot selection while fitting piecewise linear
> splines to two variables x and y? Which package to use to do it simply? I
> also want to visualize the splines (and the scatter plot) with a graph.
> Anupam
NB: linear splines, i.e. piecewise
2018 Jun 28
1
Null pointer dereference in Rf_isVector()
Hello,
After some fuzz testing I found a problem with Rf_isVector() function in
R 3.5.0.
Platform: Ubuntu 16.04
Compiler: Clang-4.0 (from Ubuntu's repository) + ASAN
Crashing R code:
2024 Jul 26
1
Automatic Knot selection in Piecewise linear splines
dear all,
I apologize for my delay in replying you. Here my contribution, maybe
just for completeness:
Similar to "earth", "segmented" also fits piecewise linear relationships
with the number of breakpoints being selected by the AIC or BIC
(recommended).
#code (example and code from Martin Maechler previous email)
library(segmented)
o<-selgmented(y, ~x, Kmax=20,