-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMake_package.R
49 lines (39 loc) · 1.08 KB
/
Make_package.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
## ################################
##
## Make Package Codes
##
## ################################
## Remove pkg
remove.packages("phtt")
## Create/update documentation and (re-)write NAMESPACE
devtools::document()
## CRAN-check pkg
devtools::check() # check the package
## Install
devtools::install_local("phtt", force = TRUE)
devtools::install_github("lidom/R-package-phtt", force = TRUE)
##
## #################################
## usethis
# Run once to configure package to use pkgdown
#usethis::use_pkgdown()
# Run to build the website
pkgdown::build_site()
#
## usethis::use_pkgdown_github_pages()
data(Cigar)
## Panel-Dimensions:
N <- 46
T <- 30
## Dependent variable:
## Cigarette-Sales per Capita
l.Consumption <- log(matrix(Cigar$sales, T,N))
## Independent variables:
## Consumer Price Index
cpi <- matrix(Cigar$cpi, T,N)
## Real Price per Pack of Cigarettes
l.Price <- log(matrix(Cigar$price, T,N)/cpi)
## Real Disposable Income per Capita
l.Income <- log(matrix(Cigar$ndi, T,N)/cpi)
## Estimation:
KSS.fit <- KSS(l.Consumption~l.Price+l.Income, CV=TRUE)