i just new with rcpp, i have a problem with my rcpp function, when i directly run App, the program display error could not find function "krit". but when i run the function partially with CTRL+R and then run App the program is running well. is there a code for call R function from rcpp function in shiny that i must not run the function partially? in other words, when i directly run App the shiny will running well. this is the example code...
server
library(shiny)
library(Rcpp)
krit <- function(n){
mat <- matrix(1,n,1)
return(mat)
}
cppFunction('
NumericMatrix tes1(int n){
Function krit("krit");
NumericMatrix test = krit(n+1);
return(test);
}
')
shinyServer(function(input, output) {
output$testing <- renderUI({
list(
renderPrint(tes1(3))
)
})
})
ui
library(shiny)
shinyUI(fluidPage(
titlePanel("Shiny Text"),
sidebarLayout(
sidebarPanel(
),
mainPanel(
uiOutput("testing")
)
)
))
