iNZightVIT / iNZightTools

Functions for integration of iNZight GUI to iNZight packages.
https://inzightvit.github.io/iNZightTools/
1 stars 5 forks source link

combine_vars exporting issues? #218

Closed chrk623 closed 7 months ago

chrk623 commented 7 months ago
Error in dplyr::mutate(., newcol = forcats::fct_cross(forcats::fct_na_value_to_level(Region.Geo,  : 
  ℹ In argument: `newcol = forcats::fct_cross(...)`.
Caused by error:
! 'fct_na_value_to_level' is not an exported object from 'namespace:forcats'

When running:

iNZightTools::combine_vars(
    data = d,
    vars = c("Region.Geo", "Country"),
    sep = "_",
    name = "new_col"
)

Dataset:

d = structure(list(Region.Geo = structure(c(8L, 1L, 18L, 18L, 2L, 
8L, 8L, 8L, 6L, 13L), levels = c("Africa - Central", "Africa - Eastern", 
"Africa - Northern", "Africa - Southern", "Africa - Western", 
"America - Central", "America - North", "America - South", "Asia - Central", 
"Asia - Eastern", "Asia - South Eastern", "Asia - Southern", 
"Asia - Western", "Europe - Eastern", "Europe - Northern", "Europe - Southern", 
"Europe - Western", "Oceania"), class = "factor"), Country = structure(c(195L, 
179L, 153L, 147L, 65L, 58L, 44L, 44L, 84L, 51L), levels = c("Afghanistan", 
"Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", 
"Angola", "Anguilla", "Antigua and Barbuda", "Argentina", "Armenia", 
"Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", 
"Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", 
"Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", 
"Brazil", "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", 
"Burundi", "Cambodia", "Cameroon", "Canada", "Cayman Islands", 
"Central African Republic", "Chad", "Channel Islands", "Chile", 
"China", "Colombia", "Comoros", "Cook Islands", "Costa Rica", 
"Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", 
"Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Germany", 
"Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", 
"Eritrea and Ethiopia", "Estonia", "Ethiopia", "Faeroe Islands", 
"Falkland Islands (Malvinas)", "Fiji", "Finland", "France", "French Guiana", 
"French Polynesia", "Gabon", "Gambia", "Georgia", "Germany", 
"Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", 
"Guam", "Guatemala", "Guernsey", "Guinea", "Guinea-Bissau", "Guyana", 
"Haiti", "Holy See", "Honduras", "Hong Kong China", "Hungary", 
"Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Isle of Man", 
"Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", 
"Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Lao", "Latvia", 
"Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", 
"Luxembourg", "Macao  China", "Madagascar", "Malawi", "Malaysia", 
"Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", 
"Mauritania", "Mauritius", "Mayotte", "Mexico", "Monaco", "Mongolia", 
"Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", 
"Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", 
"New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", 
"Niue", "Norfolk Island", "Northern Mariana Islands", "North Korea", 
"Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", 
"Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", 
"Puerto Rico", "Qatar", "Romania", "Russian Federation", "Rwanda", 
"Saint Helena", "Saint Kitts and Nevis", "Saint Lucia", "Saint-Pierre-et-Miquelon", 
"Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", 
"Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", 
"Singapore", "Slovak Republic", "Slovenia", "Solomon Islands", 
"Somalia", "South Africa", "South Sudan", "Spain", "Sri Lanka", 
"Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Taiwan", 
"Tajikistan", "Thailand", "Timor-Leste", "Togo", "Tokelau", "Tonga", 
"Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", 
"Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", 
"United States of America", "Uruguay", "Uzbekistan", "Vanuatu", 
"Venezuela", "Vietnam", "Wallis et Futuna", "West Bank and Gaza Strip", 
"Western Sahara", "Yemen", "Zambia", "Zimbabwe"), class = "factor")), class = "data.frame", row.names = c(NA, -10L))
chrk623 commented 7 months ago

@tmelliott who's incharge of iNzightTools right now? Or should I look into this?

tmelliott commented 7 months ago

@chrk623 have you checked the version of forcats? That function was added in 1.0.0.

tmelliott commented 7 months ago

Will probably be fixed by #219