delta-rho / docs-RHIPE

Tutorial and function reference for trelliscope
7 stars 2 forks source link

Error in example #3

Closed hafen closed 9 years ago

hafen commented 9 years ago

@XiaosuTong, can you test and fix the example for map2 to be the following. The code as is errors out because it is looking for a "county" attribute that is not there. I don't know when this changed but it's not good to have this sitting exposed.

map2 <- expression({
  lapply(seq_along(map.keys), function(r) {
    outputvalue <- data.frame(
      FIPS = map.keys[[r]],
      county = attr(map.values[[r]], "location")["county"],
      min = min(map.values[[r]]$listing, na.rm = TRUE),
      median = median(map.values[[r]]$listing, na.rm = TRUE),
      max = max(map.values[[r]]$listing, na.rm = TRUE),
      stringsAsFactors = FALSE
    )
    outputkey <- attr(map.values[[r]], "state")
    rhcollect(outputkey, outputvalue)
  })
})
XiaosuTong commented 9 years ago

@hafen Done!