Skip to content

Christina's LIS Rant

Post I wish I had time to write: Scientific meetings and motherhood

Christina Pikas February 24, 2015 Conferences / scholarly communication

I was reading Potnia’s new post on meetings – why to go to them – and nodding my head vigorously (ouch) and connecting that to the part of the dissertation I’m writing now on tweeting meetings and the research over the years on how scientific meetings work and contribute…

and I got very sad. I’m a real extrovert and a magpie of all sorts of different kinds of research, but I can’t justify spending my limited time reading articles that aren’t pretty directly relevant to my job or my dissertation. When I went to bunches of meetings, I could soak a million little tidbits up, meet the people doing the work, browse lots of posters and talk to their authors. It’s really a very efficient way to see what’s up with a field.

and now… I haven’t been to a conference since I was in my first trimester with my twins 🙁   Sure, I’ve listened in to some webinars and followed some tweets. It’s not enough.

Would childcare at a venue help?  I don’t know… I’d still have to get them there, I’d have to trust the childcare (what if I got there and checked them out and didn’t like what I saw?), and I’m paying for childcare at home even when I go and money is super tight now with my income being the only one in our household for more than a year.  I thought about bringing my sister along and then we could see the sights together outside of hours. My work would pay my travel and my room and so I’d just have to pay her travel and everyone’s food. But I can’t really even swing that right now….

 

So yeah… at least there’s twitter. The post I’d like to write actually cites references and what not.

And I’m only the 10 millionth person to have this issue this year so I  know I’m not a special snowflake but that doesn’t mean I can’t still bitch about it.

Read More...

Exporting high resolution graphs from RStudio

Christina Pikas February 12, 2015 Off Topic

This may not be obvious until you look into it but apparently the default export from RStudio –  if you use the nifty little tool in plots tab on the lower right hand side –  is 72dpi. This is fine for showing on web pages, typically, but is not enough for print. Particularly if you’re submitting to a journal or something like that. There’s lots of advice, but I found it somewhat confusing.

RStudio Interface for Windows from RStudio.com
RStudio Interface for Windows from RStudio.com

I found these posts helpful:

  • http://blog.revolutionanalytics.com/2009/01/10-tips-for-making-your-r-graphics-look-their-best.html
  • https://danieljhocking.wordpress.com/2013/03/12/high-resolution-figures-in-r/
  • http://www.r-bloggers.com/exporting-nice-plots-in-r/

I think someone I was reading just got out of RStudio and did his work in the standard interface. Really, there’s no need for that. I also read somewhere that Cairo is not really used any more? There is a way to export to pdf from RStudio and check a box to use Cairo…

Here’s what I did.

CairoPDF(file="something.pdf", width=11, height=8.5, family="Helvetica", pointsize=11)

set.seed(1337)

plot.igraph(g, layout=layout.fruchterman.reingold, edge.arrow.size=0.4, edge.color="black", vertex.size=V(g)$degree, vertex.label.dist=V(g)$vertex.label.dist, vertex.label.color="black", vertex.label.family="sans",edge.curved=TRUE, vertex.label.cex=V(g)$vertex.label.cex, edge.lty=E(g)$edge.lty, vertex.frame.color=V(g)$frame.color)

dev.off()

A couple of notes:

  • I found I needed to increase the arrowhead size
  • I needed to decrease the font size
  • I needed to set a seed so I was only changing one thing at a time as I experimented
  • When I did png, my dotted lines didn’t look so dotted anymore. I didn’t feel like messing with that further


Cairo(file="something.png", type="png", units="in", width=10, height=7, pointsize=12, dpi=300)

set.seed(1337)

plot.igraph(g, layout=layout.fruchterman.reingold, edge.arrow.size=0.1, edge.color="black", vertex.size=V(g)$degree, vertex.label.dist=V(g)$vertex.label.dist, vertex.label.color="black", vertex.label.family="sans",edge.curved=TRUE, vertex.label.cex=V(g)$vertex.label.cex, edge.lty=E(g)$edge.lty, vertex.frame.color=V(g)$frame.color)

dev.off()

Read More...

So… um… what if I’m still enjoying it?

Christina Pikas February 5, 2015 dissertation

Am I supposed to kind of hate my dissertation topic by now? If I don’t, does that mean I’m not working on it hard enough (maybe)? I’m doing it wrong? Maybe it’s a phase and it will pass.

Making progress. Learning new stuff from my data. Feeling horribly inadequate when watching tweets fly by from another doctoral student dissertating on how scientists use blogs…. (holy moly how many scientists did she actually interview? hundreds? cray-cray… or am I a hater?)

Working on it every chance I get – taking a morning off every week. Staying up late. .. I will have to add more time off. If only we could afford more childcare!

Read More...

Using more of the possible dimensions in a network graph

Christina Pikas January 30, 2015 information analysis

When doing bibliometrics, or social network analysis or any kind of network graph, there are only so many different ways to convey information.

  • Size of nodes
  • Shape of nodes (including pictures)
  • Color of nodes
  • Border of nodes (or multiple borders)
  • Labels (node or edge)
  • Edge weight
  • Edge color
  • Arrows
  • Shading areas around/behind nodes
  • Layout or arrangement of nodes

Of these, I almost always size nodes by degree (connections to other nodes), do thickness of lines by their weight, and do some sort of energy or spring layout.

If I do some sort of clustering or community detection or even want to call out components, I’ll do that with node color.

My normal things are easy in any package that will graph networks. I was working on a project where we were looking at the maturity of a particular part of an industry. As part of these, we wanted to know if the necessary component systems were available from multiple suppliers and if those suppliers had relationships with different system integrators and if their things were operational or were just for lab or testing purposes.

We could have done a graph for each sub system but they wanted this graph to really just be one slide in a fairly small deck. I tried various approaches in Gephi and NetDraw and wasn’t excited. So back to R and iGraph.  In the end (anonymized) :

igraphgraph
Resulting graph – minus any labels.

I used:

  • node shape for if a component or a system integrator
  • color for type of component
  • size for degree
  • line dashed or dotted for if it was in operation or not

I really wanted to show different shapes for each category but igraph only has like 6 default ones and they don’t look all that different from each other. NetDraw has more. I tried to use raster images – but I’m on a windows machine and I found all that very confusing.

One unfortunate thing about this graph is that I had to list companies multiple times if they had offerings in multiple categories.

Customer seemed to like it.

I’m not going to take the time to anonymize all the code but here are some key pieces – ask if there’s anything I figured out that you don’t immediately see how to do.
I started with a spreadsheet (3 of us librarians were adding data)
nodetable tab:
id label category

edgetable tab:
source target yes/no notes

These I imported into gephi (super easy)… and then tried all sorts of stuff… and then exported into graphml
#read in the graph
g<-read.graph("g.graphml", format="graphml")


#shape nodes. these work, but you can't have n/a. so there has to be a default. also, there is an easier way
for (i in 1:101)ifelse(V(g)[i]$Category=='category', V(g)[i]$shape<-'circle', V(g)[i]$shape<-'square')

#color of nodes - a simple number will draw from the palette. see below
for (i in 1:101)if(V(g)[i]$Category=="category"){V(g)[i]$color<-1}

#calculate and keep the degree. i use it again for label placement (not shown) and to bold some labels (not shown)
V(g)$degree<-degree(g, mode="all")

#when I tested the graphing, the isolates were all mixed in and messed up all the labels.
#subgraph to show isolates separately
gi<-induced.subgraph(g,V(g)$degree==0)
gnoni<-induced.subgraph(g,V(g)$degree!=0)

#make dotted lines for not operational
for (i in 1:76) ifelse (E(gnoni)[i]$"operational"=="yes", E(gnoni)[i]$edge.lty<-1,E(gnoni)[i]$edge.lty<-2)

#prettier colors
library("RColorBrewer", lib.loc="~/R/win-library/3.1")
mypalette<-brewer.pal(6,"Paired")
palette(mypalette)

#legend definitions
colors <- c('gray40', 1,2,3,4,5,6) labels <- vector of categories


#plot graph keep device open
plot.igraph(gnoni, layout=layout.fruchterman.reingold, edge.arrow.size=0.1, edge.color="black", vertex.size=V(gnoni)$degree, vertex.label.dist=V(gnoni)$vertex.label.dist, vertex.label.color="black", vertex.label.family="sans",edge.curved=TRUE, vertex.label.cex=0.8, edge.lty=E(gnoni)$edge.lty)

#put legends on - isolates are just shown as a legend so they are neatly lined up
#could have been done by plotting points

legend("bottomright",legend=labels, fill=colors, border="black", cex=0.7, inset=c(-0.1,0))
legend("topleft", legend=V(gi)$label, pch=19, col=V(gi)$color, cex=0.7, bty="n", y.intersp=0.5)
legend("topright", legend=c("Yes", "No"), lty=c(1,2), cex=0.7,inset=c(-0.02,0))

Read More...
  • 1
  • 2
  • 3
Scientopia logo

Visit other Scientopia Blogs

  • Search this blog

    Recent Posts

    • You don’t have to cite it if you steal it from a blog and other amazing statements
    • The ephemerality of ebooks
    • Preparing your online media for after your death
    • International Conference on the Science of Science and Innovation – Day 3
    • International Conference on the Science of Science and Innovation – Day 2 PM

    Archives

    Categories

    Contribute to Scientopia

    Click here to toss some change in our contribution jar. All funds donated will be used solely to support Scientopia's operating costs. See our Code for more information on our funding policies.
    Would you prefer to subscribe to donate monthly?
    Support level

    Recent Comments

    • Christina Pikas on What do you do when you have defunded all public services for decades and there’s a public health emergency?
    • Christina Pikas on The only thing necessary for the triumph of evil…
    • Bill Grant on The only thing necessary for the triumph of evil…
    • Christina Pikas on What do you do: publisher wants a higher increase because you use their journals more
    • Ariel on What do you do: publisher wants a higher increase because you use their journals more
    Find me on Mastodon

    Where am I?

    N 39 W 76

    Research Blogging Awards 2010 Finalist

    Research Blogging Awards 2010 Finalist

    Locations of visitors to this page


    Creative Commons License

    Christina's LIS Rant by Christina K. Pikas is licensed under a Creative Commons Attribution 3.0 Unported License.

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    This work is licensed under a Creative Commons Attribution 4.0 International License. | Theme by WordPress Theme Detector