I have this code in Gauss.
if prodc((lowerlb2[.,2] .le thxseq[.,2]).*(thxseq[.,2] .le upperlb2[.,2]))==1; count_bb[2,2] = count_bb[2,2] 1; endif;
Any help for executing this particular statement in R will be appreciated.
I have this code in Gauss.
if prodc((lowerlb2[.,2] .le thxseq[.,2]).*(thxseq[.,2] .le upperlb2[.,2]))==1; count_bb[2,2] = count_bb[2,2] 1; endif;
Any help for executing this particular statement in R will be appreciated.
I do not have access to your data e.g. lowerlb2
, but this is how to do the example in the documentation in R:
In Gauss:
x = { 1 2 3,
4 5 6,
7 8 9 };
y = prodc(x);
28
y = 80
162
In R:
library(tidyverse)
data <- tribble(
~a, ~b, ~c,
1, 2, 3,
4, 5, 6,
7, 8, 9
)
lapply(data, prod)
#> $a
#> [1] 28
#>
#> $b
#> [1] 80
#>
#> $c
#> [1] 162
Note that lapply
instead of apply
is used.
There is a free book at https://r4ds.had.co.nz/ to learn data analysis in R using the tidyverse.