Hope it helps.
>
>
>
> Best,
>
>
>
> JJB
>
>
>
> *From: *Rcpp-devel on
> behalf of Francisco Bischoff
> *Date: *Friday, January 15, 2021 at 8:05 PM
> *To: *Dirk Eddelbuettel
> *Cc: *"rcpp-devel@lists.r-forge.r-project.org" <
&g
helps.
Best,
JJB
From: Rcpp-devel on behalf of
Francisco Bischoff
Date: Friday, January 15, 2021 at 8:05 PM
To: Dirk Eddelbuettel
Cc: "rcpp-devel@lists.r-forge.r-project.org"
Subject: Re: [Rcpp-devel] Ranges and Casting
Thanks for the tips.
Still, Range() is the correct way to write
Thanks for the tips.
Still, Range() is the correct way to write:
NumericVector my_vec(200);
my_vec(Range(0,10)) = 10;
?
Thanks in advance
--
Francisco Bischoff, MD, MSc
Faculty of Medicine of the University of Porto, Portugal
- Master of Medical Informatics | topic: time series
- Research
Hello,
About the Range() function, I think it should handle decreasing ranges
too...
But, idk if using Matlabs approach or R approach:
R's:
a <- 1
b <- 10
print(a:b)
1 2 3 4 5 6 7 8 9 10
print(b:a)
10 9 8 7 6 5 4 3 2 1
Matlab's
a = 1;
b = 10;
disp(a:b);
1 2 3 4 5 6 7 8 9 10
disp(b:a);
numeric(
On 16 January 2021 at 01:35, Francisco Bischoff wrote:
| About the Range() function, I think it should handle decreasing ranges
| too...
| But, idk if using Matlabs approach or R approach:
|
| R's:
|
| a <- 1
| b <- 10
|
| print(a:b)
| 1 2 3 4 5 6 7 8 9 10
| print(b:a)
| 10 9 8 7 6 5 4 3 2 1
|
Francisco,
On 5 January 2021 at 13:58, Francisco Bischoff wrote:
| First of all, let me thank all involved with the Rcpp package!
|
| I just have a (maybe silly) question, but I struggle with this frequently
| in my codes:
|
| Range() vs IntegerVector
|
| One example is when I need a reverse i
Hello everyone,
First of all, let me thank all involved with the Rcpp package!
I just have a (maybe silly) question, but I struggle with this frequently
in my codes:
Range() vs IntegerVector
One example is when I need a reverse index, like R's 10:1, so I had to
write my own function that return