Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in col2rgb(d) : invalid color name in tweenr

Tags:

r

animation

I'm getting this error a lot in using tweenr in RStudio on mac but I'm unable to replicate it using dummy dataset. My dataset is a list of data frames with I want to apply tween_states. Works fine on dummy data, but always return Error in col2rgb(d) : invalid color name and recognise my first character column as a 'color' whenever I use real data.

like image 402
santoku Avatar asked Jun 01 '17 15:06

santoku


2 Answers

Hard to be sure, but I think you are passing too many columns to the tweenr function.

The data you send to the tweenr function should be trimmed column wise to only contain the columns used as argument names and one additional column of values that will be tweened

like image 125
guyabel Avatar answered Oct 16 '22 11:10

guyabel


Getting the same issue! I fixed it by making sure the first column only has numbers, no strings. For whatever reason the first column is interpreted as colors if it contains strings. I didn't need to trim any columns down as the other poster suggested.

like image 20
spops Avatar answered Oct 16 '22 13:10

spops