Displaying 6 results from an estimated 6 matches for "logicalvector".
2020 Feb 19
2
How to index the occasions in a vector repeatedly under condition 1? if not, it will give a new index.
Dear all,
Could you please help me how to get the output as I described in the following example?
x<-c(543, 543, 543, 543, 551 , 551 ,1128 ,1197, 1197)
diff<-x-lag(x)
diff
[1] NA 0 0 0 8 0 577 69 0
How to index the occasions in x repeatedly if the diff<15? if diff>=15, it will give a new index.
I want the output be like y.
y<-c(1,1,1,1,1,1,2,3,3)
Thank you so
2020 Feb 19
2
How to index the occasions in a vector repeatedly under condition 1? if not, it will give a new index.
Dear all,
Could you please help me how to get the output as I described in the following example?
x<-c(543, 543, 543, 543, 551 , 551 ,1128 ,1197, 1197)
diff<-x-lag(x)
diff
[1] NA 0 0 0 8 0 577 69 0
How to index the occasions in x repeatedly if the diff<15? if diff>=15, it will give a new index.
I want the output be like y.
y<-c(1,1,1,1,1,1,2,3,3)
Thank you so
2009 Aug 05
2
Counting things
I've completed an experiment and want to summarize the results.
There are two things I like to create.
1) A simple count of things from the data.frame with predictions
1a) Number of predictions with probability greater than x
1b) Number of predictions with probability greater than x that are
really true
In SQL, this would be,
"Select count(predictions) from
2009 May 14
3
memory usage grows too fast
Hi All,
I have a 1000x1000000 matrix.
The calculation I would like to do is actually very simple: for each row, calculate the frequency of a given pattern. For example, a toy dataset is as follows.
Col1 Col2 Col3 Col4
01 02 02 00 => Freq of ?02? is 0.5
02 02 02 01 => Freq of ?02? is 0.75
00 02 01 01 ?
My code is quite simple as the following to find the pattern ?02?.
2010 May 17
0
Rcpp 0.8.0 on CRAN
...---------------------------
SEXP type | Rcpp class
----------------------------------------------------------
INTSXP | Rcpp::IntegerVector
REALSXP | Rcpp::NumericVector
RAWSXP | Rcpp::RawVector
LGLSXP | Rcpp::LogicalVector
CPLXSXP | Rcpp::ComplexVector
STRSXP | Rcpp::CharacterVector
VECSXP | Rcpp::List
EXPRSXP | Rcpp::ExpressionVector
----------------------------------------------------------
ENVSXP | Rcpp::Environment
SYMSXP | Rcpp::S...
2010 May 17
0
Rcpp 0.8.0 on CRAN
...---------------------------
SEXP type | Rcpp class
----------------------------------------------------------
INTSXP | Rcpp::IntegerVector
REALSXP | Rcpp::NumericVector
RAWSXP | Rcpp::RawVector
LGLSXP | Rcpp::LogicalVector
CPLXSXP | Rcpp::ComplexVector
STRSXP | Rcpp::CharacterVector
VECSXP | Rcpp::List
EXPRSXP | Rcpp::ExpressionVector
----------------------------------------------------------
ENVSXP | Rcpp::Environment
SYMSXP | Rcpp::S...