Archive for the 'Off Topic' category
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.
I found these posts helpful:
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)
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)
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)
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)
Another random Python note. I asked at work again in the Python group of our internal social networking thingy and consensus was that I should try PyCharm as a development environment.
All the stinking tutorials are like use a text editor and command line - and that's what I'd been doing - but with R, RStudio is so fantastic that I thought surely there must be something workable for Python. I had tried the eclipse plugin and I couldn't even get it to run a program and i couldn't figure out what it was doing and ugh.
PyCharm now has a community edition so you don't even have to prove you're a student or pay for it. It's lovely, really. I don't see why I should have to use VI like it's 1991 or beat on something with rocks to see where I'm missing a quote or have the wrong indents. Why not have help? I'm trying to accomplish a task not create art.
I really do have to continue coding and stop playing with Python. Particularly since when I do I end up losing hours of my life when I'm supposed to be sleeping!
Abigail Goben (Hedgehog Librarian) has a recent blog post discussing some of the shortcomings she's identified in the various coding courses she's taken online and the self-study she has done.
I think my view overlaps hers but is not the same. Instead of try to compare and contrast, I'll say what I've seen and what I need.
I'm probably pretty typical of my age: I had BASIC programming in elementary and high school. This was literally BASIC and was like
10 print "hello"
20 goto 10
I think we did something with graphics in high school, but it was more BASIC. In college, they felt very strongly that physics majors should learn code, so I took the Pascal for non-CS majors in my freshman year. That was almost like the BASIC programming: no functions, no objects... kinda do this, do this, do this... turn it in. I never did see any connection whatsoever with my coursework in physics. I never understood why I would use that instead of the Mathematica we had to use in diffeq
All of these classes - if they weren't in interactive mode, they could have been. What are the various data types. How do you get data in there and back out again. How do you do a for loop. Nobody really goes into any depth about lists in R and they pop up all over the place. I couldn't even get Python installed on my computer at first by myself because everyone teaching me was on a Mac. (btw, use active python and active perl if you're on Windows - not affiliated, but they just work).
The R class on Coursera (same one she complains about) and the data science class by JH there were the first that even really made me do functions. What a difference. I really appreciated them for that.
So here's what I think:
People new to programming - truly new - need to understand the basics of how any program works including data types, getting data in and out, for loops. But also architectural things like functions and objects. They probably need to spend some time with pseudocode just getting through the practice.
Then if you're not new to programming, but you're new to a language - different course. In that course you say this is how this language varies, this is what it does well with, here's where it fails.
Then there needs to be an all about software design or engineering or process course that talks about version control and how to use it. How to adequately document your code. How to write programs in a computationally efficient way. The difference between doing things in memory or not. What are integrated development environments and when would you use one. This is what I need right now.
If it's something basic, I can follow along a recipe I can read off of stack overflow, but I know nothing about efficiency. Like why use sapply vs. a for loop? Is there a better way to load the data in? Why is it slow? Is it slower than I should expect? I love RStudio - love, love, love! But I tried something like that for Python and could never get it to work. I'm still learning git, but I don't really understand the process of it even though I can go through the steps.
Anyhow, more about me, but I think I'm probably pretty typical. I think there's a huge gap in the middle in what's being taught and I also think that a lot of people need the very basics of programming almost minus the specific language.
This is so true you have to laugh and not cry. This was pointed out by Mary Beard, The Public Voice of Women, February 14, 2014, online at http://www.lrb.co.uk/2014/02/14/mary-beard/the-public-voice-of-women . Originally from Punch (here) and drawn by Riana Duncan.
I don't believe I ever met F.W. Lancaster but I so value his work. His books and articles are so practical and useful. Clearly written. They're pretty much timeless, too. For example, his book: Lancaster, F. W. (1993). If you want to evaluate your library (2nd ed.). Champaign, IL: University of Illinois Graduate School of Library and Information Science, is on my bookshelf at work, and I do pull it down from time to time to reference various parts.
There's a blog post from UIUC with his bio.
Give now through the end of the campaign and you can get matching funds for your projects. As you're checking out, enter SCIENCE in the "match or gift code" box. My site is at: http://www.donorschoose.org/donors/viewChallenge.html?id=263580 or pick any projects from any Scientopian's page!
I'm a little late so please help me catch up! Donor's Choose is a great charity that collects small donations to put toward teachers' projects. There's accountability for where the money goes and you get to pick the projects. Each year groups of science bloggers have a competition to see who can raise the most.
I've selected a few interesting projects from my home state, so please consider donating to them. See them on the sidebar or go directly to the page at: http://www.donorschoose.org/donors/viewChallenge.html?id=263580 Not your cup of tea? Then please donate to another Scientopian's projects (see where we stand on the motherboard).
If you follow me on twitter, you likely know this already, but I thought I would post some additional information here. This is really TMI if you're just looking for information on library and info science, so you might want to skip this.
My spring project was to give birth to twins, and I did that, but few things go as planned. I was due on 4/12/2012 and I had a pretty uneventful pregnancy up to the very end of February. It was really remarkably uneventful. Then, all of the sudden, out of nowhere, my blood pressure started to go up quickly. I got put on bedrest at home on 2/29. My blood pressure continued to go up, my extremities got very swollen, I had a big weight gain in a short time, ... and then protein in my urine, my platelets were off, and my liver enzymes were off.... well, for people who have had this, it's pretty clear. I developed pre-eclampsia.
The babies were happy. They weren't at all ready to go anywhere. They passed their biophysical profiles with flying colors. I honestly don't really care about my own health and 2 of the OBs in the practice were of the mind to keep monitoring me to let the pregnancy progress. Yes there is some risk of liver and other damage but it's reversible after delivery.
Then, on Friday March 9, the OB who was on call called me at 9pm to ask me to come in to L&D for monitoring. She was not of the let's watch it mentality, she was of the holy-cow-this-looks-bad mentality. So when she brought me in and they did another blood test, the results were pretty stable (had not really gotten worse from other tests), but she still made the call that I needed to deliver immediately. I was still hoping for a vaginal birth and as of that morning, twin A had been head down so it was possible. B had flipped during the day, and now had his leg between A and the exit, but there was some hope. So they moved me to a delivery room and administered Cervidil - which was completely miserable and absolutely ineffective.
So flash forward past a night of cramps (side effect of the medicine), 3 monitor bands strapped tightly around my belly (they were scratchy and rubbed my tender stretch marks), loud heartbeats (reassuring only for the first 30min and then just obnoxious that the nurse didn't turn the monitor down), and laying in the most uncomfortable position (they couldn't get the monitors to stay on in preferred positions)... The morning ultrasound showed that twin A flipped again and both babies were breech.
So I had a c-section on March 10. Baby A (a girl, 5lb, 18.25") was born at 11:34 and baby B (a boy, 4.1lb, 17") was born between 1 and 10 minutes later, depending on what documentation you look at. They did a spinal block and epidural, and it was all amazingly painless. My husband was there the whole time holding my hand. The biggest deal was trying to get them to give me my glasses so I could see when they did hold the babies up. Well, a bigger deal was how I couldn't have the babies on my chest after birth. In fact, I really didn't get to see much of B - he was whisked off to the NICU. My husband was able to take some pictures and he was able to hold A and bring her to me and hold her up to my face.
I was then in recovery for a much longer time than typical as they monitored my blood pressure. That's when the whole family descended and my husband took them one at a time to the NICU and by the nursery window. So the whole family saw twin B before I really did. A few hours later they wheeled me through the nicu on the way to the maternal child ward so I could visit him.
By this time I had told everyone who would listen and some people who wouldn't that I intend to breastfeed and I need my babies. Finally in the MCU they brought my girl and I was able to give it a go with her. My husband didn't stay over - no one did - so they had to take her back in the nursery when I was there alone because I couldn't get out of bed. The next day they finally got me up - only around lunch time - and I took a shower and then headed off to the NICU to try to see and hold my son.
Nothing really went as intended. It was miserable with one baby in the NICU and the other in the nursery or my room. Also, I really wasn't up to walking because my feet were total balloons and my sciatic nerve was still hurting. The NICU had very strict rules (of course) but every nurse interpreted them differently. They talked a good game about kangaroo care and bf mothers, but in reality it was very difficult to actually get there to bf and I wasn't allowed to unwrap my baby to put him on my chest or to wake him for breastfeeding. They kept telling me how he might not be able to latch but the boy had no such issues... They insisted on a bottle - they wouldn't use any kind of alternate method except for a feeding tube. I pumped every chance I got so they would at least give that to him.
Anyway, long story short. The girl and I came home on the Wednesday and we went and picked up the boy on Friday. Since then it's been feed, change, sleep... feed, change, sleep. I have short term disability leave until 5/4 and then we'll see what happens next.
Oh, and I guess I'm looking for suggestions about what to call them here on the blog. Janet calls hers sprogs. There is a mini-z... what should I call mine?
And don't worry, this won't become a mommy blog. I'm still me
I've started on a new project that is consuming a lot of energy (more than the amount available, it sometimes seems), and I've finally decided to announce it here. This is not to excuse the lack of posting, though. I do feel somewhat energized by ASIST and hope to get back on the blogging horse soon.
So here it is: my husband and I are happy to announce that we're expecting twins in the spring (April 12,2012).
These are our first and we're scared to death. Everything seems to be nominal so...
Anyway, it's been a pleasure to use the resources of the medical institution that is another division of my parent institution. I've been consulting MDConsult and AccessMedicine regularly with all the little things. I think I'm actually scaring the doctors a bit, but it's all good. Now back to your regularly scheduled programming. (congratulations are welcome as long as they don't come with a tummy rub, lol)