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

Set x-axis as factor in indicator_native_range_year() #105

Closed
damianooldoni opened this issue Mar 27, 2023 · 1 comment
Closed

Set x-axis as factor in indicator_native_range_year() #105

damianooldoni opened this issue Mar 27, 2023 · 1 comment
Labels

Comments

@damianooldoni
Copy link
Collaborator

Empty histograms are returned. See below. They should not be shown.

library(readr)
datafile <- paste0(
  "https://raw.githubusercontent.com/trias-project/indicators/master/data/",
  "interim/data_input_checklist_indicators.tsv"
)
data <- read_tsv(datafile,
  na = "",
  col_types = cols(
    .default = col_character(),
    key = col_double(),
    nubKey = col_double(),
    speciesKey = col_double(),
    first_observed = col_double(),
    last_observed = col_double()
  )
)
a <- indicator_native_range_year(data, years = c(2010,2013, 2015))
a$static_plot

image

@damianooldoni damianooldoni changed the title Set x-axis as factor in Set x-axis as factor in indicator_native_range_year Mar 27, 2023
@damianooldoni
Copy link
Collaborator Author

Notice that 0 values are present in slot data as well:

a$data
# A tibble: 20 × 5
# Groups:   year [4]
   year  native_range     n total
   <fct> <fct>        <int> <int>
 1 2010  Africa          31   341
 2 2011  Africa           0     0
 3 2012  Africa           0     0
 4 2013  Africa          34   224
 5 2010  America         80   341
 6 2011  America          0     0
 7 2012  America          0     0
 8 2013  America         43   224
 9 2010  Asia           102   341
10 2011  Asia             0     0
11 2012  Asia             0     0
12 2013  Asia            50   224
13 2010  Europe          98   341
14 2011  Europe           0     0
15 2012  Europe           0     0
16 2013  Europe          80   224
17 2010  Oceania         30   341
18 2011  Oceania          0     0
19 2012  Oceania          0     0
20 2013  Oceania         17   224
# ℹ 1 more variable: perc <dbl>

@damianooldoni damianooldoni changed the title Set x-axis as factor in indicator_native_range_year Set x-axis as factor in indicator_native_range_year() Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant