That ::: is telling you that getLevels is an unexported/internal function. If you see the use of this and want access to that function, the two standard solutions are,
- Contact the package author and ask them to export the function. (which might make sense for complicated functions)
- Copy the function, and cite original author as needed.
That all being said in this case just take option 2. getLevels is a very simple function that gets the factor levels of a factor vector. (Some background on factors in R)
Add this function, replace all plotly:::getLevels with getLevels, and you're off to the races!
getLevels <- function (x) {
if (is.factor(x))
levels(x)
else sort(unique(x))
}