data-lessons / neon-r-make-pretty-maps-plots Goto Github PK
View Code? Open in Web Editor NEWMaking pretty maps reposit
Making pretty maps reposit
See README.md for attempts so far in getting to work.
Hey @bbest @megwilliams @kwiter -- did any of you work on creating a map (or have you done this) where you have a shapefile (eg the roads_streams lines shapefile in our data ), and you create a map with the lines colored by category. IN essence "TYPE" or an attribute becomes a factor. We have the following below which seems a bit cumbersome but works. We are using the roads_streams shapefile.
I am not sure how to add a legend or to make a nice categorical plot. Is there a simple way to do and teach this?
Thanks for any ideas!
#color lines by TYPE attribute
type <- slot(object = lines, name = "data")$TYPE
#you can also write
type <- lines@data$TYPE
col <- rep(x= "black", length = length(type))
col[type == "footpath"] <- "red"
plot(x=lines, col=col,add=T)
Here is the latest version of the lesson that i'm working on
https://github.com/data-lessons/NEON-R-Spatial-Vector/blob/gh-pages/00-open-a-shapefile.Rmd
This issue is related to #4
where some interactive components don't render properly via jekyll. we might need to consider a local build option.
"You might consider opening a separate issue that tries to reconcile bringing these lessons together into a single site, factoring in this closed issue as a factor for consideration (if you want to include htmlwidgets) and one possibility to generate output (ie by skipping use of Jekyll and opting for simpler rendering methods like brew and Makefile)."
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.