Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Care to explain the key.entries portion of that code? Commented Dec 15, 2015 at 21:24
  • @Lauren, I avoid lattice at all cost (which includes spplot and bubble). As such, I expanded my answer to accomplish this in base plot. Commented Dec 15, 2015 at 22:57
  • I'm having a hard time working my way through the first bit of code, but I'm certainly more familiar with the second option you suggested (reclassing the vector sizes/colors). Is there a way to use this same type of code structure but with real numbers? So instead of branches$share == .03, x, I would need to use branches$share <= 0.3, x. Unfortunately, this type of structure gives me an error saying that <= is not useful for factors. My data is listed as factors, but they should be considered real numbers. It appears that as.real is now defunct. Commented Dec 16, 2015 at 17:54
  • If R is automatically coercing a column to a factor it is because of something contained in the data (eg., special character, quoted text). If the data is quoted and coercion is not because there is a special character in the column you can just defactorize the data using: df$x <- as.numeric(as.character(df$x)) Commented Dec 16, 2015 at 18:33
  • @Lauren, the mapview looks like it may be a more tractable route cartographically but, please work through the code I provided as it is what we commonly refer to as a "teachable moment" and will help bolster your understanding of R in general. Commented Dec 16, 2015 at 20:57