-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathbuild.R
executable file
·55 lines (46 loc) · 1.32 KB
/
build.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
50
51
52
53
library(devtools)
#Package building
document()
install()
build()
test()
#Rbuild('likert',vignettes=FALSE)
build_vignettes()
check(cran=TRUE)
# Build website
pkgdown::build_site()
# Ready for CRAN?
release()
##### Basic testing
library(likert)
ls('package:likert')
#Run shiny app. See also shinyLikert to run from the installed package.
shiny::runApp('likert/inst/shiny')
##### testthat
usethis::use_testthat()
usethis::use_test('duplicate_gruops_124')
##### Data setup. We will use a few of the student items from North America PISA
require(pisa)
data(pisa.student)
pisaitems <- pisa.student[,substr(names(pisa.student), 1,5) %in%
c('CNT', #Country
'ST24Q', #Read attitude
'ST25Q', #Like reading
'ST26Q', #Online
'ST27Q', #Study
'ST34Q', #Teachers
'ST36Q', #Lessons
'ST37Q', #Stimulate
'ST38Q', #Strategies
'ST39Q', #Library
'ST41Q', #Text
'ST42Q', #Summary
paste('PV', 1:5, 'MATH', sep=''),
paste('PV', 1:5, 'READ', sep=''),
paste('PV', 1:5, 'SCIE', sep='')
)]
pisaitems <- pisaitems[pisaitems$CNT %in% c('Canada','Mexico','United States'),]
pisaitems$CNT <- as.factor(as.character(pisaitems$CNT))
names(pisaitems); nrow(pisaitems); ncol(pisaitems)
save(pisaitems, file='likert/data/pisaitems.rda')
tools::resaveRdaFiles('likert/data/pisaitems.rda')