Extracts the embedded R and Cpp portions from a cpp file.

check_embedded_r(state)

check_cpp(state)

Arguments

state

An exercise state, as returned by ex().

Value

A child state.

Examples

# NOT RUN {
# Example solution cpp
#include 
using namespace Rcpp ;

// [[Rcpp::export]]
int answer(){
  return 42 ;
}

/*** R
x <- answer()
x
*/

# SCT
ex() %>% check_cpp(.) %>% check_code(., "return//s+42//s+;")
ex() %>% check_embedded_r(.) %>% check_function("answer") %>% check_result()

# }