SymbolixAU / jsonify

R package to convert R objects to JSON
https://symbolixau.github.io/jsonify/
Other
67 stars 10 forks source link

Example Rcpp does not work #73

Open JosiahParry opened 1 year ago

JosiahParry commented 1 year ago

The example at https://symbolixau.github.io/jsonify/index.html#what-do-you-mean-by-available-at-the-source does not work. DESCRIPTION file contains

LinkingTo: 
    Rcpp,
    jsonify

And in src/jsonify-testing.cpp contains

// [[Rcpp::depends(jsonify)]]
#include "jsonify/jsonify.hpp"

Rcpp::StringVector my_json( Rcpp::DataFrame df ) {
  return jsonify::api::to_json( df );
}

Sourcing the file or documenting the package results in the error

/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/jsonify/include/jsonify/jsonify.hpp:5:10: fatal error: 'rapidjson/document.h' file not found
   #include "rapidjson/document.h"
dcooley commented 1 year ago

Thanks - I've updated the docs, but to get it work you also need to include rapidjsonr in the LinkingTo:

LinkingTo:
  Rcpp,
  rapidjsonr (>= 1.2.0),
  jsonify