Graphing 3 Variable Scatterplot R -


i imported data islander , trying graph 3 variables. i'm thinking of trying graph 2 numeric variables nominal category (gender). plot i'm trying therefore regular scatterplot, color-coded.

i looked @ starter tutorial on r: scatterplots, didn't see mention of 3 variable plotting.

http://www.laptopmag.com/articles/ssd-upgrade-tutorial

can me out? variables hold values pertaining number of balls bounced, minutes of physical activity per week, , gender.

picture of data:
data

since gender binary variable (usually, otherwise ternary), plot 2d scatterplot color encoding gender.

dummy data:

a = data.frame(x=runif(100), y = runif(100)+2, group = round(runif(100))+1 ) 

now plot y against x using a$group select color:

plot(a$y, a$x, pch = 16, col = c('cornflowerblue', 'springgreen')[a$group]) 

output:

example

if have missingness add third group color vector. here bunch of other solutions 2d scatter color


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -