Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: CodeDepends
Version: 0.3-5
Version: 0.3-6
Title: Analysis of R code for reproducible research and code comprehension
Description: This package provides some code for analyzing R expressions
or blocks of code and determining the dependencies between them.
Expand Down
7 changes: 4 additions & 3 deletions R/codeDepends.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,10 @@ function(e, collector = inputCollector(), basedir = ".", reset = FALSE, input =
# an assignment.
if(is.symbol(e[[1]]) && as.character(e[[1]]) %in% c("<-", "=", "<<-")) {
# Do the left hand side first.
#if it is a simple name, then it is an output,
#if it is a simple name (or a character value),
# then it is an output,
# but otherwise it is a call and may have more inputs.
if(!is.name(e[[2]])) {
if(!(is.name(e[[2]]) || is.character(e[[2]]))) {

# if this is a x$foo <- val or x[["foo"]] = val or x[i, j] <- val
# make certain to add the variable being updated as an input.
Expand All @@ -231,7 +232,7 @@ function(e, collector = inputCollector(), basedir = ".", reset = FALSE, input =
# Do the right hand side
lapply(e[-c(1,2)], getInputs, collector, basedir = basedir, input = TRUE, formulaInputs = formulaInputs, update = FALSE)

if(is.name(e[[2]]))
if(is.name(e[[2]]) || is.character(e[[2]]))
collector$set(asVarName(e[[2]]))
else {
# handle, e.g.
Expand Down