-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rprofile
27 lines (25 loc) · 977 Bytes
/
.Rprofile
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
print('.Rprofile run for project: NARCISOAfunc')
options(error=utils::recover)
options(warn=1)
options(stringsAsFactors=FALSE)
options(Paths=local({
Paths <- getOption("Paths")
Paths$RCode <- paste0(getwd(),"/R")
# Extend path-list here
return(Paths)
}))
invisible(sapply(c('EmilMisc','devtools','roxygen2',local({
libs <- readLines('DESCRIPTION')
if(any(grepl('Imports:',libs))) {
imps <- libs[grep('Imports:',libs):length(libs)]
imps <- imps[(2-(nchar(imps[1])>8)):(grep('^[^ ]', imps[-1]))[1]]
imps <- gsub('(^ +)|(^Imports: *)|( *\\(.*\\)),?','',imps)
} else imps <- NULL
if(any(grepl('Depends:',libs))) {
deps <- libs[grep('Depends:',libs):length(libs)]
deps <- deps[(2-(nchar(deps[1])>8)):(grep('^[^ ]', deps[-1]))[1]]
deps <- gsub('(^ +)|(^Depends: *)|( *\\(.*\\)),?','',deps)
deps <- deps[deps!='R']
} else deps <- NULL
c(imps, deps)
})), function(p) {suppressPackageStartupMessages(library(p, character.only=TRUE))}))