bubble() is a function in the sp package. You must install that package before the first time you use it and then you must load the package for each R session where you want to use it.
If you have not downloaded the package yet, run
install.packages("sp")
When you want to use it in an R session, run
library(sp)