Professional Documents
Culture Documents
2011
Studying galaxies in the nearby Universe,
using R and ggplot2
Alastair Sanderson
Astrophysics & Space Research Group,
University of Birminham
!!!"sr"#ham"ac"u$%&a'rs
()entaurus A( ala*y
+essier ,1 ala*y
-maes credit. Astronomy /icture 0f the 1ay
Alastair Sanderson, useR! 2011
Overview
A taste of multivariate data visualization in an
Astronomical context, demonstrating the power of
R and ggplot2!
Similar distri#utions for each type, #ut much narro!er pea$ for brightest
group earl tpes, !hich live close to roup centre
E eom?ru2data:BG5, alpha:0"K3
E eom?ru2data:BG5, alpha:0"K3
E eom?density2alpha:0"KK3
E eom?density2alpha:0"KK3
Alastair Sanderson, useR! 2011
)uantile*+uantile plot o( velocity
distribution
Uuantile>Auantile plot to
demonstrate Gaussian 2normal3
distri#ution of ala*y velocities
!ithin roups
Aplot2*:An, y:svel, data:A3 E coord?eAual23 E
eom?a#line2intercept:0, slope:1, linetype:23
Aplot2*:An, y:svel, data:A3 E coord?eAual23 E
eom?a#line2intercept:0, slope:1, linetype:23
A => ddply2A, "2lnum3, transform, svel : scale2vel, scale:mad2vel333
A<An => AAnorm2A<svel, plot:SA4S53<*
A => ddply2A, "2lnum3, transform, svel : scale2vel, scale:mad2vel333
A<An => AAnorm2A<svel, plot:SA4S53<*
Use ro#ust sdev estimator
to suppress outlier #ias
Sorce eAual
si9e in * & y
0utliers. infallin or
interloper ala*ies
Alastair Sanderson, useR! 2011
Galaxy spatial distribution in groups
5arly>type ala*ies
preferentially found in
hihest density reions
Aplot2ra, dec, data:df, si9e:4B, colour:svel, shape:morph, alpha:0",3 E
scale?si9e2trans:Blo10B3 E eom?density2d2aes2roup:13, leend:SA4S53 E """
Aplot2ra, dec, data:df, si9e:4B, colour:svel, shape:morph, alpha:0",3 E
scale?si9e2trans:Blo10B3 E eom?density2d2aes2roup:13, leend:SA4S53 E """
4GG KKT, a$a
DG) ,0PP Group
Alastair Sanderson, useR! 2011
,*type morphology vs- radius
Assem#le multiple
panels for each ala*y
roup
1ash#oard function
applied across all
roups usin d_ply(),
!ith a proress #ar
d?ply2 A, "2id3, /lot/anels, "proress:;te*t; 3
d?ply2 A, "2id3, /lot/anels, "proress:;te*t; 3
(/lot/anels( is the user(s
function to create the
dash#oard
Alastair Sanderson, useR! 2011
Diversity o( group properties
4GG 1QQ 4GG K@T
similar spatial
distributions, but
$%% &'' (left)
has onl & earl#
tpe galax(((
Alastair Sanderson, useR! 2011
.urther R*related reading
See the (plot2( #oo$ and the paper on the use of the
(plyr( pac$ae 2V" Stat" Soft", vol P0, issue 13, #oth #y
Cadley Fic$ham.