We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e379776 commit fb89148Copy full SHA for fb89148
inst/include/Rcpp/DataFrame.h
@@ -26,8 +26,11 @@ namespace Rcpp{
26
27
namespace internal{
28
inline SEXP empty_data_frame(){
29
- SEXP dataFrameSym = ::Rf_install( "data.frame");
30
- return ::Rf_eval( ::Rf_lang1( dataFrameSym ), R_GlobalEnv ) ;
+ Shield<SEXP> df = Rf_allocVector(VECSXP, 0);
+ Rf_setAttrib(df, R_NamesSymbol, Rf_allocVector(STRSXP, 0));
31
+ Rf_setAttrib(df, R_RowNamesSymbol, Rf_allocVector(INTSXP, 0));
32
+ Rf_setAttrib(df, R_ClassSymbol, Rf_mkString("data.frame"));
33
+ return df;
34
}
35
36
0 commit comments