Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
datautils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bioinfo
datautils
Commits
8d0d405a
Commit
8d0d405a
authored
Apr 21, 2015
by
Holger Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed cache_it to always include hash in file names
parent
d80c7663
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
R/core_commons.R
R/core_commons.R
+2
-2
No files found.
R/core_commons.R
View file @
8d0d405a
...
@@ -169,8 +169,8 @@ replaceNA <- function(x, withValue) { x[is.na(x)] <- withValue; x }
...
@@ -169,8 +169,8 @@ replaceNA <- function(x, withValue) { x[is.na(x)] <- withValue; x }
## related: http://cran.r-project.org/web/packages/R.cache/R.cache.pdf
## related: http://cran.r-project.org/web/packages/R.cache/R.cache.pdf
cache_it
<-
function
(
expr
,
cacheName
=
paste0
(
"cache_"
,
substr
(
digest
::
digest
(
expr
),
1
,
6
))
){
cache_it
<-
function
(
expr
,
filePrefix
=
"cache"
){
cacheFile
<-
paste0
(
"."
,
cacheName
,
".RData"
)
cacheFile
<-
paste0
(
filePrefix
,
"_"
,
substr
(
digest
::
digest
(
expr
),
1
,
6
))
%>%
paste0
(
"."
,
.
,
".RData"
)
if
(
file.exists
(
cacheFile
)){
if
(
file.exists
(
cacheFile
)){
local
(
get
(
load
(
cacheFile
)))
local
(
get
(
load
(
cacheFile
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment