This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Rcpp.h> | |
using namespace Rcpp; | |
// [[Rcpp::export]] | |
List modiframe(DataFrame& df ) { | |
//nrow and ncol of the dataframe: | |
int nrow = df.nrows(), ncol= df.size() ; | |
double moy(0); | |
//define an empty list~dataframe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(data.table) | |
mysample=alloc_opti_data.table() | |
get_echantillon_data.table=function( | |
dataset=yourDataset, | |
alea=1435, | |
set.alea=TRUE, | |
strate="strate2013", | |
eff=mysample[,list(strate2013,nh=round(nh))]) | |
{ | |
if (set.alea==TRUE) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(data.table) | |
alloc_opti_data.table=function(n=1000 | |
,dataset=ese_op2013_reste | |
,strate="strate2013" | |
,sd=ecart_type ) | |
{ | |
#count obs per strata to form Nh: | |
dataset=data.table(dataset) | |
output=dataset[,.N,by=strate] |
NewerOlder