Skip to content

Commit

Permalink
merging 496 back to master (#689)
Browse files Browse the repository at this point in the history
* merging 496 back to master

* turn into proper code blocks

* Update beam.conf

reset beam config

* get failing tests back up

* touch to get new build

* flaky test

* touch to rebuild

* make await short

* ignore single mode spec as on master

* analysis scripts

* cleaning up sf-light data

* change await to 60 sec

* updating PhyssimCalcLinkStats

* restart maybe flakey test
  • Loading branch information
colinsheppard authored and wrashid committed Oct 3, 2018
1 parent 6c34ac1 commit ba89816
Show file tree
Hide file tree
Showing 52 changed files with 1,323 additions and 283 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ scalafmt {
// configFilePath = ".scalafmt.conf" // .scalafmt.conf in the project root is default value, provide only if other location is needed
}

compileScala.dependsOn(scalafmtAll)
//compileScala.dependsOn(scalafmtAll)

// Task to run scala tests, as Scala tests not picked up by Gradle by default.
task spec(dependsOn: ['testClasses'], type: JavaExec) {
Expand Down Expand Up @@ -570,3 +570,4 @@ task execute(type:JavaExec) {
}
}
}

14 changes: 7 additions & 7 deletions docs/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,37 +112,37 @@ Production versus test data. Any branch beginning with "production" or "applicat

However, sometimes troubleshooting / debugging / development happens on a production branch. The cleanest way to get changes to source code or other non-production files back into master is the following.

Checkout your production branch:
Checkout your production branch::

git checkout production-branch

Bring branch even with master
Bring branch even with master::

git merge master

Resolve conflicts if needed

Capture the files that are different now between production and master:
Capture the files that are different now between production and master::

git diff --name-only HEAD master > diff-with-master.txt

You have created a file "diff-with-master.txt" containing a listing of every file that is different.

IMPORTANT!!!! -- Edit the file diff-with-master.txt and remove all production-related data (this typically will be all files underneath "production" sub-directory.

Checkout master
Checkout master::

git checkout master

Create a new branch off of master, this is where you will stage the files to then merge back into master:
Create a new branch off of master, this is where you will stage the files to then merge back into master::

git checkout -b new-branch-with-changes-4ci

Do a file by file checkout of all differing files from production branch onto master:
Do a file by file checkout of all differing files from production branch onto master::

cat diff-with-master.txt | xargs git checkout production-branch --

Note, if any of our diffs include the deletion of a file on your production branch, then you will need to remove (i.e. with "git remove" these before you do the above "checkout" step and you should also remove them from the diff-with-master.txt". If you don't do this, you will see an error message ("did not match any file(s) known to git.") and the checkout command will not be completed.
Note, if any of our diffs include the deletion of a file on your production branch, then you will need to remove (i.e. with "git remove" these before you do the above "checkout" step and you should also remove them from the diff-with-master.txt"). If you don't do this, you will see an error message ("did not match any file(s) known to git.") and the checkout command will not be completed.

Finally, commit the files that were checked out of the production branch, push, and go create your pull request!

Expand Down
32 changes: 17 additions & 15 deletions src/main/R/beam-utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ load.libraries(c('GEOquery','XML'))

clean.and.relabel <- function(ev,factor.to.scale.personal.back,factor.to.scale.transit.back,val.of.time=16.9){
# Clean and relabel
ev[vehicle_type=="bus",vehicle_type:="Bus"]
ev[vehicle_type=="CAR" | substr(vehicle,1,5)=="rideH",vehicle_type:="TNC"]
ev[vehicle_type=="subway",vehicle_type:="BART"]
ev[vehicle_type=="bus",vehicle_type:="BUS-DEFAULT"]
ev[vehicle_type=="CAR",vehicle_type:="Car"]
ev[substr(vehicle,1,5)=="rideH",mode:="ride_hail"]
ev[vehicle_type=="subway",vehicle_type:="SUBWAY-DEFAULT"]
ev[vehicle_type=="SUV",vehicle_type:="Car"]
ev[vehicle_type=="cable_car",vehicle_type:="Cable_Car"]
ev[vehicle_type=="tram",vehicle_type:="Muni"]
ev[vehicle_type=="rail",vehicle_type:="Rail"]
ev[vehicle_type=="ferry",vehicle_type:="Ferry"]
ev[vehicle_type=="cable_car",vehicle_type:="CABLE_CAR-DEFAULT"]
ev[vehicle_type=="tram",vehicle_type:="TRAM-DEFAULT"]
ev[vehicle_type=="rail",vehicle_type:="RAIL-DEFAULT"]
ev[vehicle_type=="ferry",vehicle_type:="FERRY-DEFAULT"]
transit.types <- c('BUS-DEFAULT','FERRY-DEFAULT','TRAM-DEFAULT','RAIL-DEFAULT','CABLE_CAR-DEFAULT','SUBWAY-DEFAULT')
ev[,tripmode:=ifelse(mode%in%c('subway','bus','rail','tram','walk_transit','drive_transit','cable_car','ferry'),'transit',as.character(mode))]
ev[,hour:=time/3600]
ev[,hr:=round(hour)]
Expand All @@ -25,9 +27,9 @@ clean.and.relabel <- function(ev,factor.to.scale.personal.back,factor.to.scale.t
if(is.factor(ev$fuel[1]))ev[,fuel:=as.numeric(as.character(fuel))]
ev[start.y<=0.003 | end.y <=0.003,':='(start.x=NA,start.y=NA,end.x=NA,end.y=NA)]
ev[length==Inf,length:=NA]
ev[vehicle_type%in%c('BART','Ferry','Muni','Rail','Cable_Car') & !is.na(start.x) & !is.na(start.y) & !is.na(end.y) & !is.na(end.y),length:=dist.from.latlon(start.y,start.x,end.y,end.x)]
ev[vehicle_type%in%c('BART','Bus','Cable_Car','Muni','Rail'),num_passengers:=round(num_passengers*factor.to.scale.personal.back)]
ev[vehicle_type%in%c('BART','Bus','Cable_Car','Muni','Rail'),capacity:=round(capacity*factor.to.scale.transit.back)]
ev[vehicle_type%in%transit.types & !is.na(start.x) & !is.na(start.y) & !is.na(end.y) & !is.na(end.y),length:=dist.from.latlon(start.y,start.x,end.y,end.x)]
ev[vehicle_type%in%transit.types,num_passengers:=round(num_passengers*factor.to.scale.personal.back)]
ev[vehicle_type%in%transit.types,capacity:=round(capacity*factor.to.scale.transit.back)]
ev[num_passengers > capacity,num_passengers:=capacity]
ev[,pmt:=num_passengers*length/1609]
ev[is.na(pmt),pmt:=0]
Expand All @@ -41,8 +43,8 @@ clean.and.relabel <- function(ev,factor.to.scale.personal.back,factor.to.scale.t
ev
}

pretty.titles <- c('TNC Number'='ridehail_num',
'TNC Price'='ridehail_price',
pretty.titles <- c('Ride Hail Number'='ridehail_num',
'Ride Hail Price'='ridehail_price',
'Transit Capacity'='transit_capacity',
'Transit Price'='transit_price',
'Toll Price'='toll_price',
Expand All @@ -57,8 +59,8 @@ to.title <- function(abbrev){
}
}
pretty.modes <- function(ugly){
pretty.list <- c('TNC'='ride_hail',
'TNC'='ride_hail',
pretty.list <- c('Ride Hail'='ride_hail',
'Ride Hail - Transit'='ride_hail_transit',
'Cable Car'='cable_car',
'Car'='car',
'Walk'='walk',
Expand Down Expand Up @@ -89,7 +91,7 @@ parse.link.stats <- function(link.stats.file,net.file=NA){
}

my.colors <- c(blue='#377eb8',green='#227222',orange='#C66200',purple='#470467',red='#B30C0C',yellow='#C6A600',light.green='#C0E0C0',magenta='#D0339D',dark.blue='#23128F',brown='#542D06',grey='#8A8A8A',dark.grey='#2D2D2D',light.yellow='#FFE664',light.purple='#9C50C0',light.orange='#FFB164',black='#000000')
mode.colors <- c(TNC='red',Car='grey',Walk='green',Transit='blue')
mode.colors <- c('Ride Hail'='red',Car='grey',Walk='green',Transit='blue','Ride Hail - Transit'='purple')
mode.colors <- data.frame(key=names(mode.colors),color=mode.colors,color.hex=my.colors[mode.colors])

download.from.nersc <- function(experiment.dir,include.pattern='*'){
Expand Down
3 changes: 1 addition & 2 deletions src/main/R/bin/csv2Rdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ option_list <- list(
)
if(interactive()){
#setwd('~/downs/')
args<-'/Users/critter/Downloads/2014-Clipper.csv'
args<-'/Users/critter/Downloads/output 3/application-sfbay/base__2018-06-18_16-21-35/ITERS/it.1/1.events.csv'
args<-'/Users/critter/Downloads/output 2/application-sfbay/RH2Transit_Plus10__2018-09-26_04-55-53/ITERS/it.10/10.events.csv'
args <- parse_args(OptionParser(option_list = option_list,usage = "csv2Rdata.R [file-to-convert]"),positional_arguments=T,args=args)
}else{
args <- parse_args(OptionParser(option_list = option_list,usage = "csv2Rdata.R [file-to-convert]"),positional_arguments=T)
Expand Down
121 changes: 65 additions & 56 deletions src/main/R/bin/exp2plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ option_list <- list(
)
if(interactive()){
#setwd('~/downs/')
args<-'/Users/critter/Documents/beam/beam-output/experiments/2018-04/surge-pricing/'
args<-'/Users/critter/Documents/beam/beam-output/experiments/2018-04/ridehail-price/'
args<-'/Users/critter/Downloads/RH2Transit-2Iter/RH2Transit'
args<-'/Users/critter/Downloads/cost-sensitivities/cost-sensitivity/'
#args<-'/Users/critter/Downloads/diffusion-5iter/diffusion/'
args <- parse_args(OptionParser(option_list = option_list,usage = "exp2plots.R [experiment-directory]"),positional_arguments=T,args=args)
}else{
args <- parse_args(OptionParser(option_list = option_list,usage = "exp2plots.R [experiment-directory]"),positional_arguments=T)
}
######################################################################################################

factor.to.scale.personal.back <- 35
factor.to.scale.transit.back <- 2
# TODO make these come from conf file
factor.to.scale.personal.back <- 20
factor.to.scale.transit.back <- 1/.22 # inverse of param: beam.agentsim.tuning.transitCapacity
plot.congestion <- F
plot.modality.styles <- F

######################################################################################################
# Load the exp config
Expand Down Expand Up @@ -72,21 +75,25 @@ for(run.i in 1:nrow(exp)){
}
links[[length(links)+1]] <- link
}
last.iter.minus.5 <- ifelse(last.iter>4,last.iter - 4,1)
for(the.iter in last.iter.minus.5:last.iter){
pop.csv <- pp(run.dir,output.dir,'/ITERS/it.',the.iter,'/',the.iter,'.population.csv.gz')
if(file.exists(pop.csv)){
pop <- csv2rdata(pop.csv)
pop[,iter:=the.iter]
streval(pp('pop[,',fact,':="',the.level,'"]'))
pops[[length(pops)+1]] <- pop
if(plot.modality.styles){
last.iter.minus.5 <- ifelse(last.iter>4,last.iter - 4,1)
for(the.iter in last.iter.minus.5:last.iter){
pop.csv <- pp(run.dir,output.dir,'/ITERS/it.',the.iter,'/',the.iter,'.population.csv.gz')
if(file.exists(pop.csv)){
pop <- csv2rdata(pop.csv)
pop[,iter:=the.iter]
streval(pp('pop[,',fact,':="',the.level,'"]'))
pops[[length(pops)+1]] <- pop
}
}
}
}
ev <- rbindlist(evs,use.names=T,fill=T)
rm('evs')
pop <- rbindlist(pops,use.names=T,fill=T)
rm('pops')
if(plot.modality.styles){
pop <- rbindlist(pops,use.names=T,fill=T)
rm('pops')
}
if(plot.congestion){
link <- rbindlist(links,use.names=T,fill=T)
rm('links')
Expand All @@ -97,12 +104,12 @@ ev <- clean.and.relabel(ev,factor.to.scale.personal.back,factor.to.scale.transit
setkey(ev,type)

## Prep data needed to do quick version of energy calc
en <- data.table(read.csv('~/Dropbox/ucb/vto/beam-all/beam/test/input/sf-light/energy/energy-consumption.csv'))
setkey(en,vehicleType)
en <- data.table(read.csv('~/Dropbox/ucb/vto/beam-all/beam/production/application-sfbay/samples/vehicleTypes.csv'))
setkey(en,vehicleTypeId)
en <- u(en)
## Energy Density in MJ/liter or MJ/kWh
# https://en.wikipedia.org/wiki/Gasoline_gallon_equivalent
en.density <- data.table(fuelType=c('gasoline','diesel','electricity'),density=c(31.81905,36.14286,3.6))
#en.density <- data.table(fuelType=c('gasoline','diesel','electricity','biodiesel'),density=c(31.81905,36.14286,3.6,33.2))
ev[tripmode%in%c('car') & vehicle_type=='Car',':='(num_passengers=1)]
ev[,pmt:=num_passengers*length/1609]
ev[is.na(pmt),pmt:=0]
Expand Down Expand Up @@ -132,8 +139,9 @@ for(fact in factors){
toplot[,frac:=num/tot]
toplot[,tripmode:=pretty.modes(tripmode)]
setkey(toplot,the.factor,tripmode)
p <- ggplot(toplot,aes(x=the.factor,y=frac*100,fill=tripmode))+geom_bar(stat='identity',position='stack')+labs(x="Scenario",y="% of Trips",title=pp('Factor: ',fact),fill="Trip Mode")+
scale_fill_manual(values=as.character(mode.colors$color.hex[match(sort(u(toplot$tripmode)),mode.colors$key)]))
p <- ggplot(toplot,aes(x=the.factor,y=frac*100,fill=tripmode))+geom_bar(stat='identity',position='stack')+
labs(x="Scenario",y="% of Trips",title=pp('Factor: ',fact),fill="Trip Mode")+
scale_fill_manual(values=as.character(mode.colors$color.hex[match(sort(u(toplot$tripmode)),mode.colors$key)]))
pdf.scale <- .6
ggsave(pp(plots.dir,'mode-split-by-',fact,'.pdf'),p,width=10*pdf.scale,height=6*pdf.scale,units='in')
write.csv(toplot,file=pp(plots.dir,'mode-split-by-',fact,'.csv'))
Expand All @@ -150,7 +158,7 @@ for(fact in factors){
ggsave(pp(plots.dir,'mode-split-by-hour-by-',fact,'.pdf'),p,width=10*pdf.scale,height=6*pdf.scale,units='in')
write.csv(toplot,file=pp(plots.dir,'mode-split-by-hour-',fact,'.csv'))

target <- data.frame(tripmode=rep(c('Car','Walk','Transit','TNC'),length(u(toplot$the.factor))),
target <- data.frame(tripmode=rep(c('Car','Walk','Transit','Ride Hail'),length(u(toplot$the.factor))),
perc=rep(c(79,4,13,5),length(u(toplot$the.factor))),
the.factor=rep(u(toplot$the.factor),each=4))
p <- ggplot(toplot,aes(x=tripmode,y=frac*100))+geom_bar(stat='identity')+facet_wrap(~the.factor)+geom_point(data=target,aes(y=perc),colour='red')
Expand Down Expand Up @@ -188,24 +196,23 @@ for(fact in factors){
toplot <- pt[,.(fuel=sum(fuel),numVehicles=as.double(length(fuel)),numberOfPassengers=as.double(sum(num_passengers)),pmt=sum(pmt),vmt=sum(length)/1609,mpg=sum(length)/1609/sum(fuel/3.78)),by=c('the.factor','vehicle_type','tripmode')]
toplot <- toplot[vehicle_type!='Human' & tripmode!="walk"]
if(nrow(en)>30){
toplot <- join.on(toplot,en[vehicle%in%c('SUBWAY-DEFAULT','BUS-DEFAULT','CABLE_CAR-DEFAULT','CAR','FERRY-DEFAULT','TRAM-DEFAULT','RAIL-DEFAULT')|vehicleType=='TNC'],'vehicle_type','vehicleType','fuelType')
toplot <- join.on(toplot,en[vehicleTypeId%in%c('SUBWAY-DEFAULT','BUS-DEFAULT','CABLE_CAR-DEFAULT','Car','FERRY-DEFAULT','TRAM-DEFAULT','RAIL-DEFAULT') | substr(vehicleTypeId,0,3)=='BEV'],'vehicle_type','vehicleTypeId','primaryFuelType')
}else{
toplot <- join.on(toplot,en,'vehicle_type','vehicleType','fuelType')
toplot <- join.on(toplot,en,'vehicle_type','vehicleTypeId','primaryFuelType')
}
toplot <- join.on(toplot,en.density,'fuelType','fuelType')
toplot[,energy:=fuel*density]
toplot[vehicle_type=='TNC',tripmode:='TNC']
toplot[vehicle_type%in%c('Car','TNC'),energy:=energy*factor.to.scale.personal.back*10]
toplot[vehicle_type%in%c('Car','TNC'),numVehicles:=numVehicles*factor.to.scale.personal.back]
toplot[vehicle_type%in%c('Car','TNC'),pmt:=pmt*factor.to.scale.personal.back]
toplot[vehicle_type%in%c('Car','TNC'),numberOfPassengers:=numVehicles]
toplot[,energy:=fuel] # fuel is now in units of J so no need to convert from L to J
toplot[tripmode%in%c('car','ride_hail'),energy:=energy*factor.to.scale.personal.back]
toplot[tripmode%in%c('car','ride_hail'),numVehicles:=numVehicles*factor.to.scale.personal.back]
toplot[tripmode%in%c('car','ride_hail'),pmt:=pmt*factor.to.scale.personal.back]
toplot[tripmode%in%c('car','ride_hail'),numberOfPassengers:=numVehicles]
toplot[,ag.mode:=tripmode]
toplot[tolower(ag.mode)%in%c('bart','bus','cable_car','muni','rail','tram','transit'),ag.mode:='Transit']
toplot[ag.mode=='car',ag.mode:='Car']
toplot[ag.mode=='ride_hail',ag.mode:='Ride Hail']
toplot.ag <- toplot[,.(energy=sum(energy),pmt=sum(pmt)),by=c('the.factor','ag.mode')]
pdf.scale <- .6
setkey(toplot.ag,the.factor,ag.mode)
p <- ggplot(toplot.ag,aes(x=the.factor,y=energy/1e6,fill=ag.mode))+geom_bar(stat='identity',position='stack')+labs(x="Scenario",y="Energy Consumption (TJ)",title=to.title(fact),fill="Trip Mode")+
p <- ggplot(toplot.ag,aes(x=the.factor,y=energy/1e12,fill=ag.mode))+geom_bar(stat='identity',position='stack')+labs(x="Scenario",y="Energy Consumption (TJ)",title=to.title(fact),fill="Trip Mode")+
scale_fill_manual(values=as.character(mode.colors$color.hex[match(sort(u(toplot.ag$ag.mode)),mode.colors$key)]))
ggsave(pp(plots.dir,'energy-by-mode-',fact,'.pdf'),p,width=10*pdf.scale,height=6*pdf.scale,units='in')
write.csv(toplot.ag,file=pp(plots.dir,'energy-by-mode-',fact,'.csv'))
Expand All @@ -219,11 +226,11 @@ for(fact in factors){
ggsave(pp(plots.dir,'energy-per-pmt-by-vehicle-type-',fact,'.pdf'),p,width=10*pdf.scale,height=6*pdf.scale,units='in')

# Deadheading
toplot <- pt[vehicle_type=='TNC',.(dead=num_passengers==0,miles=length/1609,hr,the.factor)]
toplot <- pt[tripmode=='ride_hail',.(dead=num_passengers==0,miles=length/1609,hr,the.factor)]
setkey(toplot,hr,dead)
dead.frac <- toplot[,.(dead.frac=pp(roundC(100*sum(miles[dead==T])/sum(miles),1),"% Empty")),by=c('the.factor')]
toplot <- toplot[,.(miles=sum(miles)),by=c('dead','hr','the.factor')]
p <- ggplot(toplot,aes(x=hr,y=miles,fill=dead))+geom_bar(stat='identity')+labs(x="Hour",y="Vehicle Miles Traveled",fill="Empty",title=pp("TNC Deadheading"))+geom_text(data=dead.frac,hjust=1,aes(x=24,y=max(toplot$miles),label=dead.frac,fill=NA))+facet_wrap(~the.factor)
p <- ggplot(toplot,aes(x=hr,y=miles,fill=dead))+geom_bar(stat='identity')+labs(x="Hour",y="Vehicle Miles Traveled",fill="Empty",title=pp("Ride Hail Deadheading"))+geom_text(data=dead.frac,hjust=1,aes(x=24,y=max(toplot$miles),label=dead.frac,fill=NA))+facet_wrap(~the.factor)
pdf.scale <- .6
ggsave(pp(plots.dir,'dead-heading.pdf'),p,width=10*pdf.scale,height=6*pdf.scale,units='in')
}
Expand All @@ -244,32 +251,34 @@ if(plot.congestion){
}
}

if('customAttributes' %in% names(pop)){
for(fact in factors){
streval(pp('pop[,the.factor:=',fact,']'))
if(all(c('low','base','high') %in% u(pop$the.factor))){
pop[,the.factor:=factor(the.factor,levels=c('low','base','high'))]
}else if(all(c('Low','Base','High') %in% u(pop$the.factor))){
pop[,the.factor:=factor(the.factor,levels=c('Low','Base','High'))]
}else{
streval(pp('pop[,the.factor:=factor(the.factor,levels=exp$',fact,')]'))
}
pop[,style:=customAttributes]
pop <- pop[style!='']
if(any(u(pop$style)=='class1')){
new.names <- c(class1='Multimodals',class2='Empty nesters',class3='Transit takers',class4='Inveterate drivers',class5='Moms in cars',class6='Car commuters')
pop[,style:=new.names[as.character(style)]]
}
toplot <- pop[,.(n=length(type)),by=c('style','the.factor','iter')]
toplot <- toplot[,.(n=mean(n)),by=c('style','the.factor')]
setkey(toplot,style,the.factor)
if(plot.modality.styles){
if('customAttributes' %in% names(pop)){
for(fact in factors){
streval(pp('pop[,the.factor:=',fact,']'))
if(all(c('low','base','high') %in% u(pop$the.factor))){
pop[,the.factor:=factor(the.factor,levels=c('low','base','high'))]
}else if(all(c('Low','Base','High') %in% u(pop$the.factor))){
pop[,the.factor:=factor(the.factor,levels=c('Low','Base','High'))]
}else{
streval(pp('pop[,the.factor:=factor(the.factor,levels=exp$',fact,')]'))
}
pop[,style:=customAttributes]
pop <- pop[style!='']
if(any(u(pop$style)=='class1')){
new.names <- c(class1='Multimodals',class2='Empty nesters',class3='Transit takers',class4='Inveterate drivers',class5='Moms in cars',class6='Car commuters')
pop[,style:=new.names[as.character(style)]]
}
toplot <- pop[,.(n=length(type)),by=c('style','the.factor','iter')]
toplot <- toplot[,.(n=mean(n)),by=c('style','the.factor')]
setkey(toplot,style,the.factor)

pdf.scale <- .8
p<-ggplot(toplot,aes(x=the.factor,y=n,fill=style))+geom_bar(stat='identity',position='stack')+labs(x='Trip #',y='# Agents',title='Modality Style Distributions')
ggsave(pp(plots.dir,'modality-styles.pdf'),p,width=10*pdf.scale,height=8*pdf.scale,units='in')
pdf.scale <- .8
p<-ggplot(toplot,aes(x=the.factor,y=n,fill=style))+geom_bar(stat='identity',position='stack')+labs(x='Trip #',y='# Agents',title='Modality Style Distributions')
ggsave(pp(plots.dir,'modality-styles.pdf'),p,width=10*pdf.scale,height=8*pdf.scale,units='in')

p<-ggplot(toplot,aes(x=style,y=n,fill=the.factor))+geom_bar(stat='identity',position='dodge')+labs(x='',y='# Agents',fill=fact,title='Modality Style Distributions')
ggsave(pp(plots.dir,'modality-styles-dodged.pdf'),p,width=10*pdf.scale,height=6*pdf.scale,units='in')
p<-ggplot(toplot,aes(x=style,y=n,fill=the.factor))+geom_bar(stat='identity',position='dodge')+labs(x='',y='# Agents',fill=fact,title='Modality Style Distributions')
ggsave(pp(plots.dir,'modality-styles-dodged.pdf'),p,width=10*pdf.scale,height=6*pdf.scale,units='in')
}
}
}

Loading

0 comments on commit ba89816

Please sign in to comment.