This is not my area of expertise, but to answer your second question, if
you're trying to depend on {arrow} in C++ in an R package, you'll need to
list arrow in LinkingTo in your DESCRIPTION, and you may need to add
useDynLib in your NAMESPACE. See
https://adv-r.hadley.nz/rcpp.html#rcpp-package, and also search those two
terms in https://cran.r-project.org/doc/manuals/r-release/R-exts.html for
more details. It's possible that getting this right will solve your
compilation problem, but I'm not sure--I'm not aware of any other R
packages that depend on {arrow} in the C++ layer.Neal On Fri, Jun 4, 2021 at 5:26 PM Aldrin <[email protected]> wrote: > Hello! > > I am trying to wrap some C++ code I have that uses arrow with R to enable > users to continue working in R. Unfortunately, I get a compilation error of > `arrow does not name a type` when it gets to the return type of my function > which is > `arrow::Result<std::shared_ptr<arrow::ipc::RecordBatchStreamReader>>`. I > posted in RStudio in case this is purely a cpp11 library issue happening ( > https://community.rstudio.com/t/cpp11-does-not-name-a-type/106740). > > However, I am trying to get this working with arrow data types. So, I just > wanted to check with this list the following things: > > - If I import the arrow library in R before trying to source C++ code > that returns an arrow data type, am I able to use the object as if I > constructed it in R? > - If I want to have an R package that I can import like the arrow > package (e.g. `library(arrow)`), what is the best way to either: > - import the arrow package from my package > - or, specify the arrow package as a dependency? > > I apologize since I know that to some extent these are primarily R > questions and not arrow questions, but I am just hoping that since the > arrow R package seems complex, it makes sense to ask these questions here > as well. > > Thank you very much for any help! > > Aldrin Montana > Computer Science PhD Student > UC Santa Cruz >
