I am using RInside library to run embed R inside C++ application. After parsing R command such as:
std::string command = "a <- 5"
const SEXP res = mRSession->parseEval( command);
I would like to know if the res is SEXP that is an R variable (the command actually comes from GUI frontend). I understand that it is somehow connected to knowing if there is SYMSXP inside the SEXP. But the actual structure of SEXP is kind of a mystery.
The overall goal is to mimic printing in console in RStudio, where SEXP values that are not linked to R variables are printed, while R variables are not printed. So command a <- 5 would not print outcome, but 5+3 would print.
I tested various functions from <RInternals.h> but none of them provided the result that I am looking for. But the main issue most likely is that I am actually looking at data of SEXP instead of its structure.