-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
309 lines (309 loc) · 9.89 KB
/
.Rhistory
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
set.seed(1)
x = matrix(rnorm(100 * 20), 100, 20)
beta = c(5,4,3,2,1,rep(0, times = 15))
y = x%*%beta + rnorm(100)
gindex = sort(rep(1:4,times=5))
fit=tscv.sglfit(x = x, y = y, gindex = gindex, gamma = 0.5,
standardize = FALSE, intercept = FALSE)
library(midasml)
set.seed(1)
x = matrix(rnorm(100 * 20), 100, 20)
beta = c(5,4,3,2,1,rep(0, times = 15))
y = x%*%beta + rnorm(100)
gindex = sort(rep(1:4,times=5))
fit=tscv.sglfit(x = x, y = y, gindex = gindex, gamma = 0.5,
standardize = FALSE, intercept = FALSE)
fit$cvm
library(midasml)
set.seed(1)
x = matrix(rnorm(100 * 20), 100, 20)
beta = c(5,4,3,2,1,rep(0, times = 15))
y = x%*%beta + rnorm(100)
gindex = sort(rep(1:4,times=5))
fit = tscv.sglfit(x = x, y = y, gindex = gindex, gamma = 0.5,
standardize = FALSE, intercept = FALSE,
K = 5, l = 3)
fit$cv.fit
rm(list=ls())
# ------- SET WORKING DIRECTORY ------- #
wd <- dirname(rstudioapi::getSourceEditorContext()$path)
setwd(wd)
require(ggplot2)
x <- NULL
#x <- dlstats::cran_stats(c("bootml"))
if (!is.null(x)) {
head(x)
p <- ggplot2::ggplot(x, aes(end, downloads, group=package, color=package)) +
geom_line() + geom_point(aes(shape=package))
p <- plotly::ggplotly(p)
p
}
#-------------- package stuff ------#
remove.packages("bootml")
# delete current compiled version
unlink(list.files(pattern = ".tar.gz"))
unlink("bootml.Rcheck", recursive = TRUE)
unlink("bootml", recursive = TRUE)
# delete previous version
unlink(paste0(wd,"/bootml"), recursive = TRUE)
# create skeleton
package.skeleton(name="bootml",
code_files = c("R/factorsparsetest.R","R/fitboot.R","R/fitbootlocal.R",
"R/utilities.R", "R/bootml-package.R"))
unlink("bootml/man", recursive = TRUE)
dir.create("bootml/man")
dir.create("bootml/src")
# copy Fortran files:
file.copy("src/auxiliary.f90", "bootml/src/auxiliary.f90")
file.copy("src/maxlambda.f90", "bootml/src/maxlambda.f90")
file.copy("src/fitnoiseF.f90", "bootml/src/fitnoiseF.f90")
file.copy("src/bootml_init.c", "bootml/src/bootml_init.c")
# delete default readme
unlink("bootml/Read-and-delete-me")
# delete default DESCRIPTION FILE
unlink("bootml/DESCRIPTION")
# delete default NAMESPACE FILE
unlink("bootml/NAMESPACE")
unlink("bootml/src/auxiliary.o")
unlink("bootml/src/maxlambda.o")
unlink("bootml/src/fitnoiseF.0")
#unlink("bootml/src/fitnoisewF.0")
# copy package description
file.copy("DESCRIPTION", "bootml/DESCRIPTION")
# copy package description
file.copy("NAMESPACE", "bootml/NAMESPACE")
# sort package .Rd file
unlink("bootml/man/bootml-package.Rd")
#file.copy("rd_file/bootml-package.Rd", "bootml/man/bootml-package.Rd")
# copy data files
#dir.create("bootml/data")
#file.copy("data_files/X", "bootml/data/X")
roxygen2::roxygenise(file.path(getwd(),"/bootml"))
# copy readme file
#file.copy("git_files/README.md", "bootml/README.md")
# other git files
#pause(2)
# .rs.restartR()
# pause(2)
system("R CMD build bootml")
install.packages("bootml_1.0.0.tar.gz", repos = NULL, type = "source")
system("R CMD check --as-cran bootml_1.0.0.tar.gz")
install.packages("V8")
rm(list=ls())
# ------- SET WORKING DIRECTORY ------- #
wd <- dirname(rstudioapi::getSourceEditorContext()$path)
setwd(wd)
require(ggplot2)
x <- NULL
#x <- dlstats::cran_stats(c("bootml"))
if (!is.null(x)) {
head(x)
p <- ggplot2::ggplot(x, aes(end, downloads, group=package, color=package)) +
geom_line() + geom_point(aes(shape=package))
p <- plotly::ggplotly(p)
p
}
#-------------- package stuff ------#
remove.packages("bootml")
# delete current compiled version
unlink(list.files(pattern = ".tar.gz"))
unlink("bootml.Rcheck", recursive = TRUE)
unlink("bootml", recursive = TRUE)
# delete previous version
unlink(paste0(wd,"/bootml"), recursive = TRUE)
# create skeleton
package.skeleton(name="bootml",
code_files = c("R/factorsparsetest.R","R/fitboot.R","R/fitbootlocal.R",
"R/utilities.R", "R/bootml-package.R"))
unlink("bootml/man", recursive = TRUE)
dir.create("bootml/man")
dir.create("bootml/src")
# copy Fortran files:
file.copy("src/auxiliary.f90", "bootml/src/auxiliary.f90")
file.copy("src/maxlambda.f90", "bootml/src/maxlambda.f90")
file.copy("src/fitnoiseF.f90", "bootml/src/fitnoiseF.f90")
file.copy("src/bootml_init.c", "bootml/src/bootml_init.c")
# delete default readme
unlink("bootml/Read-and-delete-me")
# delete default DESCRIPTION FILE
unlink("bootml/DESCRIPTION")
# delete default NAMESPACE FILE
unlink("bootml/NAMESPACE")
unlink("bootml/src/auxiliary.o")
unlink("bootml/src/maxlambda.o")
unlink("bootml/src/fitnoiseF.0")
#unlink("bootml/src/fitnoisewF.0")
# copy package description
file.copy("DESCRIPTION", "bootml/DESCRIPTION")
# copy package description
file.copy("NAMESPACE", "bootml/NAMESPACE")
# sort package .Rd file
unlink("bootml/man/bootml-package.Rd")
#file.copy("rd_file/bootml-package.Rd", "bootml/man/bootml-package.Rd")
# copy data files
#dir.create("bootml/data")
#file.copy("data_files/X", "bootml/data/X")
roxygen2::roxygenise(file.path(getwd(),"/bootml"))
# copy readme file
#file.copy("git_files/README.md", "bootml/README.md")
# other git files
#pause(2)
# .rs.restartR()
# pause(2)
system("R CMD build bootml")
install.packages("bootml_1.0.0.tar.gz", repos = NULL, type = "source")
system("R CMD check --as-cran bootml_1.0.0.tar.gz")
rm(list=ls())
# ------- SET WORKING DIRECTORY ------- #
wd <- dirname(rstudioapi::getSourceEditorContext()$path)
setwd(wd)
require(ggplot2)
x <- NULL
#x <- dlstats::cran_stats(c("FAS"))
if (!is.null(x)) {
head(x)
p <- ggplot2::ggplot(x, aes(end, downloads, group=package, color=package)) +
geom_line() + geom_point(aes(shape=package))
p <- plotly::ggplotly(p)
p
}
#-------------- package stuff ------#
remove.packages("FAS")
# delete current compiled version
unlink(list.files(pattern = ".tar.gz"))
unlink("FAS.Rcheck", recursive = TRUE)
unlink("FAS", recursive = TRUE)
# delete previous version
unlink(paste0(wd,"/FAS"), recursive = TRUE)
# create skeleton
package.skeleton(name="FAS",
code_files = c("R/factorsparsetest.R","R/fitboot.R","R/fitbootlocal.R",
"R/utilities.R", "R/FAS-package.R"))
rm(list=ls())
# ------- SET WORKING DIRECTORY ------- #
wd <- dirname(rstudioapi::getSourceEditorContext()$path)
setwd(wd)
require(ggplot2)
x <- NULL
#x <- dlstats::cran_stats(c("FAS"))
if (!is.null(x)) {
head(x)
p <- ggplot2::ggplot(x, aes(end, downloads, group=package, color=package)) +
geom_line() + geom_point(aes(shape=package))
p <- plotly::ggplotly(p)
p
}
#-------------- package stuff ------#
remove.packages("FAS")
# delete current compiled version
unlink(list.files(pattern = ".tar.gz"))
unlink("FAS.Rcheck", recursive = TRUE)
unlink("FAS", recursive = TRUE)
# delete previous version
unlink(paste0(wd,"/FAS"), recursive = TRUE)
# create skeleton
package.skeleton(name="FAS",
code_files = c("R/factorsparsetest.R","R/fitboot.R","R/fitbootlocal.R",
"R/utilities.R", "R/FAS-package.R"))
unlink("FAS/man", recursive = TRUE)
dir.create("FAS/man")
dir.create("FAS/src")
# copy Fortran files:
file.copy("src/auxiliary.f90", "FAS/src/auxiliary.f90")
file.copy("src/maxlambda.f90", "FAS/src/maxlambda.f90")
file.copy("src/fitnoiseF.f90", "FAS/src/fitnoiseF.f90")
file.copy("src/FAS_init.c", "FAS/src/FAS_init.c")
# delete default readme
unlink("FAS/Read-and-delete-me")
# delete default DESCRIPTION FILE
unlink("FAS/DESCRIPTION")
# delete default NAMESPACE FILE
unlink("FAS/NAMESPACE")
unlink("FAS/src/auxiliary.o")
unlink("FAS/src/maxlambda.o")
unlink("FAS/src/fitnoiseF.0")
#unlink("FAS/src/fitnoisewF.0")
# copy package description
file.copy("DESCRIPTION", "FAS/DESCRIPTION")
# copy package description
file.copy("NAMESPACE", "FAS/NAMESPACE")
# sort package .Rd file
unlink("FAS/man/FAS-package.Rd")
#file.copy("rd_file/FAS-package.Rd", "FAS/man/FAS-package.Rd")
# copy data files
#dir.create("FAS/data")
#file.copy("data_files/X", "FAS/data/X")
roxygen2::roxygenise(file.path(getwd(),"/FAS"))
# copy readme file
#file.copy("git_files/README.md", "FAS/README.md")
# other git files
#pause(2)
# .rs.restartR()
# pause(2)
system("R CMD build FAS")
install.packages("FAS_1.0.0.tar.gz", repos = NULL, type = "source")
system("R CMD check --as-cran FAS_1.0.0.tar.gz")
rm(list=ls())
# ------- SET WORKING DIRECTORY ------- #
wd <- dirname(rstudioapi::getSourceEditorContext()$path)
setwd(wd)
require(ggplot2)
x <- NULL
#x <- dlstats::cran_stats(c("FAS"))
if (!is.null(x)) {
head(x)
p <- ggplot2::ggplot(x, aes(end, downloads, group=package, color=package)) +
geom_line() + geom_point(aes(shape=package))
p <- plotly::ggplotly(p)
p
}
#-------------- package stuff ------#
remove.packages("FAS")
# delete current compiled version
unlink(list.files(pattern = ".tar.gz"))
unlink("FAS.Rcheck", recursive = TRUE)
unlink("FAS", recursive = TRUE)
# delete previous version
unlink(paste0(wd,"/FAS"), recursive = TRUE)
# create skeleton
package.skeleton(name="FAS",
code_files = c("R/factorsparsetest.R","R/fitboot.R","R/fitbootlocal.R",
"R/utilities.R", "R/FAS-package.R"))
unlink("FAS/man", recursive = TRUE)
dir.create("FAS/man")
dir.create("FAS/src")
# copy Fortran files:
file.copy("src/auxiliary.f90", "FAS/src/auxiliary.f90")
file.copy("src/maxlambda.f90", "FAS/src/maxlambda.f90")
file.copy("src/fitnoiseF.f90", "FAS/src/fitnoiseF.f90")
file.copy("src/FAS_init.c", "FAS/src/FAS_init.c")
# delete default readme
unlink("FAS/Read-and-delete-me")
# delete default DESCRIPTION FILE
unlink("FAS/DESCRIPTION")
# delete default NAMESPACE FILE
unlink("FAS/NAMESPACE")
unlink("FAS/src/auxiliary.o")
unlink("FAS/src/maxlambda.o")
unlink("FAS/src/fitnoiseF.0")
#unlink("FAS/src/fitnoisewF.0")
# copy package description
file.copy("DESCRIPTION", "FAS/DESCRIPTION")
# copy package description
file.copy("NAMESPACE", "FAS/NAMESPACE")
# sort package .Rd file
unlink("FAS/man/FAS-package.Rd")
#file.copy("rd_file/FAS-package.Rd", "FAS/man/FAS-package.Rd")
# copy data files
#dir.create("FAS/data")
#file.copy("data_files/X", "FAS/data/X")
roxygen2::roxygenise(file.path(getwd(),"/FAS"))
# copy readme file
#file.copy("git_files/README.md", "FAS/README.md")
# other git files
#pause(2)
# .rs.restartR()
# pause(2)
system("R CMD build FAS")
install.packages("FAS_1.0.0.tar.gz", repos = NULL, type = "source")
system("R CMD check --as-cran FAS_1.0.0.tar.gz")