Running ‘testthat.R’ [2s/36s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(fingertipsR)
  > 
  > test_check("fingertipsR")
  ── 1. Error: the area_types function works correctly (@test-area_types.R#7)  ───
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_is(area_types(), "data.frame") at testthat/test-area_types.R:7
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: area_types()
  5: paste0(path, "area_types/parent_area_types") %>% GET(use_proxy(ie_get_proxy_for_url(.), 
         username = "", password = "", auth = "ntlm")) %>% content("text") %>% fromJSON
  6: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: `_fseq`(`_lhs`)
  10: freduce(value, `_function_list`)
  11: withVisible(function_list[[k]](value))
  12: function_list[[k]](value)
  13: fromJSON(.)
  14: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  15: parseJSON(txt, bigint_as_char)
  16: parse_string(txt, bigint_as_char)
  
  ── 2. Error: the indicator_areatypes function is working correctly (@test-area_t
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_equal(ncol(indicator_areatypes()), 2) at testthat/test-area_types.R:17
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ncol(indicator_areatypes())
  5: indicator_areatypes()
  6: path %>% GET(use_proxy(ie_get_proxy_for_url(.), username = "", password = "", auth = "ntlm")) %>% 
         content("text") %>% fromJSON %>% as_tibble
  7: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: `_fseq`(`_lhs`)
  11: freduce(value, `_function_list`)
  12: function_list[[i]](value)
  13: fromJSON(.)
  14: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  15: parseJSON(txt, bigint_as_char)
  16: parse_string(txt, bigint_as_char)
  
  ── 3. Error: category_types returns as expected (@test-area_types.R#26)  ───────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_is(category_types(), "data.frame") at testthat/test-area_types.R:26
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: category_types()
  5: paste0(path, "category_types") %>% GET(use_proxy(ie_get_proxy_for_url(.), username = "", 
         password = "", auth = "ntlm")) %>% content("text") %>% fromJSON %>% pull(Categories) %>% 
         bind_rows %>% as_tibble
  6: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: `_fseq`(`_lhs`)
  10: freduce(value, `_function_list`)
  11: function_list[[i]](value)
  12: fromJSON(.)
  13: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  14: parseJSON(txt, bigint_as_char)
  15: parse_string(txt, bigint_as_char)
  
  ── 4. Error: nearest_neighbours returns as expected (@test-area_types.R#32)  ───
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_is(nearest_neighbours(AreaCode = "E06000007", AreaTypeID = 101), "character") at testthat/test-area_types.R:32
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: nearest_neighbours(AreaCode = "E06000007", AreaTypeID = 101)
  5: paste0(path, sprintf("parent_to_child_areas?parent_area_type_id=%s", AreaTypeID)) %>% 
         GET(use_proxy(ie_get_proxy_for_url(.), username = "", password = "", auth = "ntlm")) %>% 
         content("text") %>% fromJSON %>% names
  6: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: `_fseq`(`_lhs`)
  10: freduce(value, `_function_list`)
  11: function_list[[i]](value)
  12: fromJSON(.)
  13: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  14: parseJSON(txt, bigint_as_char)
  15: parse_string(txt, bigint_as_char)
  
  ── 5. Error: (unknown) (@test-deprivation.R#6)  ────────────────────────────────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: deprivation_decile() at testthat/test-deprivation.R:6
  2: fingertips_data(IndicatorID = IndicatorID, AreaTypeID = AreaTypeID, path = path) %>% 
         filter(AreaType == AreaFilter & Timeperiod == Year) %>% select(AreaCode, Value) %>% 
         rename(IMDscore = Value) %>% mutate(decile = as.integer(11 - ntile(IMDscore, 
         10)))
  3: eval(lhs, parent, parent)
  4: eval(lhs, parent, parent)
  5: fingertips_data(IndicatorID = IndicatorID, AreaTypeID = AreaTypeID, path = path)
  6: area_types(path = path)
  7: paste0(path, "area_types/parent_area_types") %>% GET(use_proxy(ie_get_proxy_for_url(.), 
         username = "", password = "", auth = "ntlm")) %>% content("text") %>% fromJSON
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: withVisible(function_list[[k]](value))
  14: function_list[[k]](value)
  15: fromJSON(.)
  16: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  17: parseJSON(txt, bigint_as_char)
  18: parse_string(txt, bigint_as_char)
  
  ── 6. Error: fingertips_redred should return a 25 field data.frame (@test-enhanc
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_equal(ncol(fingertips_redred(10101, Comparator = "England")), 25) at testthat/test-enhancements.R:12
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ncol(fingertips_redred(10101, Comparator = "England"))
  5: fingertips_redred(10101, Comparator = "England")
  6: fingertips_data(path = path, ...) %>% group_by(IndicatorID, Sex, Age, CategoryType, 
         Category) %>% filter(TimeperiodSortable == max(TimeperiodSortable) & grepl("[Ww]orse", 
         RecentTrend) & grepl("[Ww]orse", ComparedtoEnglandvalueorpercentiles))
  7: eval(lhs, parent, parent)
  8: eval(lhs, parent, parent)
  9: fingertips_data(path = path, ...)
  10: area_types(path = path)
  ...
  13: eval(quote(`_fseq`(`_lhs`)), env, env)
  14: eval(quote(`_fseq`(`_lhs`)), env, env)
  15: `_fseq`(`_lhs`)
  16: freduce(value, `_function_list`)
  17: withVisible(function_list[[k]](value))
  18: function_list[[k]](value)
  19: fromJSON(.)
  20: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  21: parseJSON(txt, bigint_as_char)
  22: parse_string(txt, bigint_as_char)
  
  This may take a few moments... ── 7. Error: fingertips_stats functionality (@test-enhancements.R#18)  ─────────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_null(fingertips_stats()) at testthat/test-enhancements.R:18
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: fingertips_stats()
  5: indicators()
  6: profiles(path = path)
  7: paste0(path, "profiles") %>% GET(use_proxy(ie_get_proxy_for_url(.), username = "", 
         password = "", auth = "ntlm")) %>% content("text") %>% fromJSON
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: withVisible(function_list[[k]](value))
  14: function_list[[k]](value)
  15: fromJSON(.)
  16: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  17: parseJSON(txt, bigint_as_char)
  18: parse_string(txt, bigint_as_char)
  
  ── 8. Error: (unknown) (@test-extract.R#6)  ────────────────────────────────────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: fingertips_data(IndicatorID = 259) at testthat/test-extract.R:6
  2: area_types(path = path)
  3: paste0(path, "area_types/parent_area_types") %>% GET(use_proxy(ie_get_proxy_for_url(.), 
         username = "", password = "", auth = "ntlm")) %>% content("text") %>% fromJSON
  4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: `_fseq`(`_lhs`)
  8: freduce(value, `_function_list`)
  9: withVisible(function_list[[k]](value))
  10: function_list[[k]](value)
  11: fromJSON(.)
  12: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  13: parseJSON(txt, bigint_as_char)
  14: parse_string(txt, bigint_as_char)
  
  ── 9. Failure: profile warnings work (@test-indicators.R#7)  ───────────────────
  `profiles(c(12, 14))` threw an error with unexpected message.
  Expected match: "ProfileID\\(s\\) are not in the list of profile IDs\\. Re-run the function without any inputs to see all possible IDs\\."
  Actual message: "parse error: premature EOF\n                                       \n                     (right here) ------^\n"
  
  ── 10. Failure: profile warnings work (@test-indicators.R#9)  ──────────────────
  `profiles(ProfileName = "PHOF")` threw an error with unexpected message.
  Expected match: "Profile names are not in the list of profile names\\. Re-run the function without any inputs to see all possible names\\."
  Actual message: "parse error: premature EOF\n                                       \n                     (right here) ------^\n"
  
  ── 11. Error: the profiles function works (@test-indicators.R#15)  ─────────────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_is(profiles(ProfileName = "Public Health Outcomes Framework"), "data.frame") at testthat/test-indicators.R:15
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: profiles(ProfileName = "Public Health Outcomes Framework")
  5: paste0(path, "profiles") %>% GET(use_proxy(ie_get_proxy_for_url(.), username = "", 
         password = "", auth = "ntlm")) %>% content("text") %>% fromJSON
  6: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: `_fseq`(`_lhs`)
  10: freduce(value, `_function_list`)
  11: withVisible(function_list[[k]](value))
  12: function_list[[k]](value)
  13: fromJSON(.)
  14: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  15: parseJSON(txt, bigint_as_char)
  16: parse_string(txt, bigint_as_char)
  
  ── 12. Error: profile indicators work (@test-indicators.R#24)  ─────────────────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_warning(indicators(ProfileID = 19, DomainID = 1938132767), "DomainID is ignored as ProfileID has also been entered") at testthat/test-indicators.R:24
  2: quasi_capture(enquo(object), capture_warnings, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: indicators(ProfileID = 19, DomainID = 1938132767)
  7: profiles(ProfileID = ProfileID, path = path)
  8: paste0(path, "profiles") %>% GET(use_proxy(ie_get_proxy_for_url(.), username = "", 
         password = "", auth = "ntlm")) %>% content("text") %>% fromJSON
  9: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: eval(quote(`_fseq`(`_lhs`)), env, env)
  12: `_fseq`(`_lhs`)
  13: freduce(value, `_function_list`)
  14: withVisible(function_list[[k]](value))
  15: function_list[[k]](value)
  16: fromJSON(.)
  17: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  18: parseJSON(txt, bigint_as_char)
  19: parse_string(txt, bigint_as_char)
  
  ── 13. Error: the indicators function works (@test-indicators.R#30)  ───────────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_is(indicators(19), "data.frame") at testthat/test-indicators.R:30
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: indicators(19)
  5: profiles(ProfileID = ProfileID, path = path)
  6: paste0(path, "profiles") %>% GET(use_proxy(ie_get_proxy_for_url(.), username = "", 
         password = "", auth = "ntlm")) %>% content("text") %>% fromJSON
  7: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: `_fseq`(`_lhs`)
  11: freduce(value, `_function_list`)
  12: withVisible(function_list[[k]](value))
  13: function_list[[k]](value)
  14: fromJSON(.)
  15: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  16: parseJSON(txt, bigint_as_char)
  17: parse_string(txt, bigint_as_char)
  
  ── 14. Error: the indicators_unique function works (@test-indicators.R#37)  ────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_is(indicators_unique(19), "data.frame") at testthat/test-indicators.R:37
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: indicators_unique(19)
  5: indicators(ProfileID, DomainID, path = path)
  6: profiles(ProfileID = ProfileID, path = path)
  7: paste0(path, "profiles") %>% GET(use_proxy(ie_get_proxy_for_url(.), username = "", 
         password = "", auth = "ntlm")) %>% content("text") %>% fromJSON
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: withVisible(function_list[[k]](value))
  14: function_list[[k]](value)
  15: fromJSON(.)
  16: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  17: parseJSON(txt, bigint_as_char)
  18: parse_string(txt, bigint_as_char)
  
  ── 15. Error: the indicator_order function works (@test-indicators.R#42)  ──────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: expect_is(indicator_order(DomainID = 3007000, AreaTypeID = 102, ParentAreaTypeID = 6), 
         "data.frame") at testthat/test-indicators.R:42
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: indicator_order(DomainID = 3007000, AreaTypeID = 102, ParentAreaTypeID = 6)
  5: paste0(path, sprintf("parent_to_child_areas?parent_area_type_id=%s", ParentAreaTypeID)) %>% 
         GET(use_proxy(ie_get_proxy_for_url(.), username = "", password = "", auth = "ntlm")) %>% 
         content("text") %>% fromJSON %>% names
  6: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: `_fseq`(`_lhs`)
  10: freduce(value, `_function_list`)
  11: function_list[[i]](value)
  12: fromJSON(.)
  13: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  14: parseJSON(txt, bigint_as_char)
  15: parse_string(txt, bigint_as_char)
  
  ── 16. Error: (unknown) (@test-metadata.R#7)  ──────────────────────────────────
  parse error: premature EOF
                                         
                       (right here) ------^
  1: suppressWarnings(indicator_metadata(IndicatorID = 10101)) at testthat/test-metadata.R:7
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: indicator_metadata(IndicatorID = 10101)
  4: indicators(path = path)
  5: profiles(path = path)
  6: paste0(path, "profiles") %>% GET(use_proxy(ie_get_proxy_for_url(.), username = "", 
         password = "", auth = "ntlm")) %>% content("text") %>% fromJSON
  7: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: `_fseq`(`_lhs`)
  11: freduce(value, `_function_list`)
  12: withVisible(function_list[[k]](value))
  13: function_list[[k]](value)
  14: fromJSON(.)
  15: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  16: parseJSON(txt, bigint_as_char)
  17: parse_string(txt, bigint_as_char)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 1 SKIPPED: 0 FAILED: 16
  1. Error: the area_types function works correctly (@test-area_types.R#7) 
  2. Error: the indicator_areatypes function is working correctly (@test-area_types.R#17) 
  3. Error: category_types returns as expected (@test-area_types.R#26) 
  4. Error: nearest_neighbours returns as expected (@test-area_types.R#32) 
  5. Error: (unknown) (@test-deprivation.R#6) 
  6. Error: fingertips_redred should return a 25 field data.frame (@test-enhancements.R#12) 
  7. Error: fingertips_stats functionality (@test-enhancements.R#18) 
  8. Error: (unknown) (@test-extract.R#6) 
  9. Failure: profile warnings work (@test-indicators.R#7) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted