Economics.
You can start the project by double-clicking Economics.Rproj file or by opening it from the RStudio project menu on the top right corner of RStudio.

In RStudio, you will find a terminal tab next to the R console. In the following instruction, when you are asked to use a terminal, you should use the terminal in RStudio. If you start the RStudio project, the current directory is set at the project directory.
When you close the RStudio and reopen it, it automatically reload the previous project. If you want start without specifying a project, untick "Tools" > "Global Options" > "General" > "Restore most recently opened project at startup".
In the following, we assume that both R console and terminal set the project folder as the current directory when you run commands.
We slightly modify the project files.
NAMESAPACE originally looks likeuseDynLib(Economics)
import(RcppEigen)
importFrom(Rcpp, evalCpp)
export("Rcpp.fake.fun")
Replace the last line as:
useDynLib(Economics)
import(RcppEigen)
importFrom(Rcpp, evalCpp)
exportPattern("^[[:alpha:]]+")
exportPattern specifies the C/C++ functions to be automatically exported as R functions. By setting the pattern as ^[[:alpha:]]+, C++ functions with a comment //[[Rcpp::export]] are automatically exported as R functions by Rcpp. With export("Rcpp.fake.fun"), only a function named Rcpp.fake.fun will be exported.
src/Makevars and src/Makevars.win, add the following line:PKG_CPPFLAGS = -w
src/Makevars controls the compile option for macOS and linux. src/Makevars.win controls them for Windows. Without -w option, compiling a project with Eigen generate many warnings. You can add as many options as you prefer.
Read-and-delete-me.Check whether the package can be built and installed to the library by choosing Build > Clean and Rebuild. If you did not apply the above modifications, you are likely to fail the build. If the build succeeds, in the build pane of RStudio, you will see something like:
==> Rcpp::compileAttributes()
Updated R/RcppExports.R
==> Rcmd.exe INSTALL --preclean --no-multiarch --with-keep.source Economics
installing to library 'C:/Users/kohei/Documents/R/win-library/4.0'