Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for AQCU-735 #357

Merged
merged 1 commit into from
Jun 17, 2016
Merged

fix for AQCU-735 #357

merged 1 commit into from
Jun 17, 2016

Conversation

mhines-usgs
Copy link
Contributor

applyDates was null sometimes and causing problems, so if applyDates was null, I turned them into NAs so it would properly shape into a df

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 71.707% when pulling 6797dfc on mhines-usgs:master into 64b4eb3 on USGS-R:master.

@mhines-usgs mhines-usgs merged commit 10134a6 into USGS-R:master Jun 17, 2016
@@ -223,6 +227,11 @@ findOverlap <- function(dataList){
dataIn$line_num <- 1

#ordered by applied date for process order data
if (isEmptyOrBlank(dataIn$applyDates)) {
for (i in 1:length(dataIn)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to have the for loop. Just making dataIn$applyDates <- NA will work because data.frame will automatically fill in the other NAs. @mhines-usgs I'll go ahead and make a fix for this since you are traveling!

Example:

dataIn <- list(values = 1:10, dates = 1:10, applyDates = NULL)
as.data.frame(dataIn)

Error in data.frame(values = 1:10, dates = 1:10, applyDates = NULL, check.names = TRUE,  : 
  arguments imply differing number of rows: 10, 0

dataIn <- list(values = 1:10, dates = 1:10, applyDates = NA)
as.data.frame(dataIn)
   values dates applyDates
1       1     1         NA
2       2     2         NA
3       3     3         NA
4       4     4         NA
5       5     5         NA
6       6     6         NA
7       7     7         NA
8       8     8         NA
9       9     9         NA
10     10    10         NA

lindsayplatt pushed a commit to lindsayplatt/repgen that referenced this pull request Jun 20, 2016
lindsayplatt pushed a commit that referenced this pull request Jun 20, 2016
removing for loop - see comments on PR #357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants