diff --git a/R/rstan_config.R b/R/rstan_config.R index d697eb3..0b436df 100644 --- a/R/rstan_config.R +++ b/R/rstan_config.R @@ -214,11 +214,12 @@ rstan_config <- function(pkgdir = ".") { eigen_incl <- ifelse(utils::packageVersion('StanHeaders') >= "2.31", "#include ", "#include ") + pkgname <- gsub("Package: ", "", readLines("DESCRIPTION", n = 1)) cat("#include ", eigen_incl, "#include ", file = file.path(pkgdir, "src", - paste(basename(pkgdir), "types.h", sep = "_")), + paste(pkgname, "types.h", sep = "_")), sep = "\n") } else { # actual Stan model