Thursday, March 7, 2013

A Title for Andy

How to Plot a Novelty Image Using ggplot2: ggoldy ggopher

ggplot2 produces lovely, high quality data visualizations often with minimal effort on the part of the R user– for which, we are all grateful. In addition to serious applications of ggplot2, however, there are more frivolous, entertaining uses of the package to explore such as the creation of novelty plots.

This is a tutorial highlighting a more fun than functional use for ggplot2: graphing a Big 10 mascot known for his “adorable chubby cheeks and toothy grin.”

You will need the ggplot2 package installed and loaded for this tutorial.

install.packages("ggplot2")
require(ggplot2)


Step One: Choosing an Image to Plot

As long as you can create or obtain (x,y) coordinates for your image, you should be able to create a ggplot version. Using a grid in a program like Photoshop, Inkscape, or even Paint can be helpful in determining the coordinates needed to render the image.


Step Two: Dataset Creation

Following along with step one, in order to create an image in ggplot, you will need a dataset containing x values, y values, and corresponding colors appropriate for your image.

Most of ggoldy is comprised of the color burlywood2 (you can find a useful color chart with names here: http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf). The first coordinate plotted from my data should be a burlywood2 colored point at (6,4).

If you have time to create graphs in the image of anthropomorphized rodents, you possibly have the free time to enter all of your coordinates into R by hand and create a dataframe (shown below). A smarter option would be entering your coordinates and corresponding colors into a .csv file and then loading that file into R using the read.csv() function.

x = c(6, 7, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 9, 10, 11, 12, 
    1, 2, 3, 10, 11, 12, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 1, 2, 3, 4, 
    9, 10, 11, 12, 13, 14, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 2, 
    6, 7, 11, 12, 2, 6, 7, 11, 12, 2, 6, 7, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 
    9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 
    7, 5, 6, 7, 8, 3, 5, 8, 10, 4, 5, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 
    12)

y = c(4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 
    8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 
    10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 
    12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 
    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 
    16, 16, 16, 16, 16, 16, 16, 9, 9, 10, 10, 10, 10, 12, 12, 12, 12, 13, 13, 
    13, 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17)

color = c("burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "Maroon", "Maroon", "Maroon", "Maroon", "Maroon", "Maroon", 
    "Maroon", "Maroon", "Maroon", "Maroon", "Maroon", "Maroon", "Maroon", "Maroon", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2", 
    "burlywood2", "burlywood2", "burlywood2", "burlywood2", "burlywood2")

Step Three: Put Your Dataset Into a Dataframe

Once you have entered and stored the coordinates and colors you wish to plot, the data should be put into a dataframe.

Note: If you read your data in from a .csv file, you do not need to do this step.

goldy = data.frame(Gopher = x, Goldy = y, color = color)

head(goldy)
##   Gopher Goldy      color
## 1      6     4 burlywood2
## 2      7     4 burlywood2
## 3      5     5 burlywood2
## 4      6     5 burlywood2
## 5      7     5 burlywood2
## 6      8     5 burlywood2

Step Four: Writing the Code

First, specify the basic plot elements by adding (data=) to the ggplot function. This builds the base of the graph, telling ggplot to pull data from your dataframe.

ggplot(data = goldy)

Next, use the geom_tile() function to inform ggplot of how you want your data to look when it is plotted. geom_tile() represents the data in a blocky visual style. All of the coordinates are plotted in a way that fills the plane with rectangles, as opposed to geom_point() which plots single points in surrounding white space.

For the creation of ggoldy, the aesthetic function takes:

  • x=
  • y=
  • fill=
  • width=
+geom_tile(aes(x = Gopher, y = Goldy, fill = color, width = 1))

Add scale_fill_identity() so ggplot knows to use the colors you specified in your dataset instead of picking default colors for you.

+scale_fill_identity()

The use of theme_bw() tells ggplot that you want a white background with black gridlines for your graph.

+theme_bw()

Once your code is complete, it should look like this:

ggplot(data = goldy) + geom_tile(aes(x = Gopher, y = Goldy, fill = color, width = 1)) + 
    scale_fill_identity() + theme_bw()

Final Step: Run Your Code

After all of that hard work, make sure ggplot2 is loaded, run your code and behold the image of our furry friend, ggoldy ggopher.

library(ggplot2)

ggplot(data = goldy) + geom_tile(aes(x = Gopher, y = Goldy, fill = color, width = 1)) + 
    scale_fill_identity() + theme_bw()

plot of chunk fullplot

Sunday, January 13, 2013

Man Pebbles...

I was once told by an English professor that my writing "oozes with voice", interestingly enough the concept of voice beyond the literary sense is important to me.  Due to my personality, and my writing style, I can sense that more rant compositions combined with pointed commentary are on the way.

For example, I am a strong proponent of women's rights, sexual liberation, and gender equality.  I also have a general fascination and respect for human sexuality.  Having worked with individuals across the human sexuality continuum from men who have committed sex offenses to middle-aged women in the early stages of menopause, to college freshmen just entering the playing field, I have a rather broad and liberal view on sexuality.  My work, and personal convictions, also reinforce and highlight my concerns regarding the current state of sexuality in the United States and the problems people face regarding sexual expression, gender identity, and sexual violence.  Of particular concern is the fact that any stereotyped behavior or propagated myths about any of the topics automatically results in a reinforced counter stereotypes; think Newton's Third for social motion instead of physical motion.  These are complex and complicated topics, and there are people working to address the issues involved.  However, it is disconcerting and somewhat infuriating to see the lack of progress being made in general society.  Most recently, my disgust has been evoked by the writings on a website a friend sent me to with only one sentence: "Try not to get grey matter on your keyboard when your head explodes."  The website, www.lovepanky.com, is the absolute epitome of why things are so completely fucked up as far as sexuality, gender identity, and sexual violence are concerned.

To be fair, I attempted to peruse the site with my broad, liberal mind and attitude.  Initially, it worked; I was impressed by the range of topics and some of the frank dialogue presented.  Then I entered the "Women" section of the site: unfathomably sexist, dated, and intellectually bereft, not to mention nauseatingly hetero-normative.  Some basic problematic elements: all pink design, referring to women as "girls", the seeming inability to use anything other than trite euphemisms for body parts ("man pebbles", seriously?!), the incessant and insipid tone of "men are strong, women are weak but devious enough to get what they need through the use of their bodies."  Given the sparse comments, I can only hope that indicates a minuscule readership.  This is what I learned reading through the site:
  • Women only wear "revealing clothes" to attract the attention of men, not because as a human being we deserve respect regardless of what we are wearing and should not be inhibited in our dress because it might "turn a guy on."  Yes, some women do dress in as little as possible to attract the attention of others, this does not mean, however, that people have the right to generalize that assumption to all women in all situations.  How has it become acceptable to assume that a woman in a revealing outfit is asking for attention, and as a result men in particular get a free pass for being disrespectful because of their "primal urges"?  The opposite reaction to this is that men who do not act disrespectfully in such situations are not normal, or real men, but most people don't overtly think about that counter.  (http://www.lovepanky.com/women/girl-talk/revealing-clothes-in-office)
  • It's more acceptable to stare at a woman's breasts if you are in her "league", or are attractive.  If you aren't though, don't think about it.  Women should only ever accept and encourage attention from good looking men, never from homely guys, and never from other women.  Also, all women love shopping!  All of us!  As a result we have tight fitting clothes because we love shopping, and we can't help ourselves from trying to attract attention.  Oh, and men totally can't control themselves, like, everrr! so, you can just expect them to stare, and as a woman you totally have to learn to get over it.  Best of all, looking at boobs can cause you to live 5 years longer!  Science proved it, and "medical experts"!!!!!  But even though they just provided all of these tips on how to oogle a woman with some respect, you should really only oogle boobs that are attached to women in movies and tv shows.  Duh. (http://www.lovepanky.com/men/guy-talk/is-it-bad-to-stare-at-a-womans-breasts)
  • Women always have to be happy and/or cheerful, look attractive, be flirty, and only be independent when men aren't around (because "...Men absolutely love a woman who asks for help...), once you're in a committed relationships though, you can expect your guy to be a lazy slob who doesn't want to help you a bit (and that's ok)!  (http://www.lovepanky.com/women/attracting-and-dating-men/what-men-like-in-women)
  • Intelligent women are cold, snobby, and arrogant.  Eww.  Women need to let men feel powerful to be appreciated and loved, which means you really need to at least pretend to be dumb part of the time, or stop pretending to be smart as the case may be.  Apparently, dumb girls, ooops "less aware girls" are more attractive because they let men feel more control, listen in rapt fascination because, golly, men are so smart and fascinating and everything they say is so important (so hot!), and dumb girls are easier to manipulate-- a key factor to a happy relationship.  Intelligent women, however, practically crush a man's fragile ego on sight and are inherently emasculating (especially when they make more money then a guy, 'cause seriously, a man's value is totally in his cock and his wallet, and men can't handle competition).  Luckily, women like me need not fear!  As an intelligent woman, I can be "normal" and have a "normal conversation" with a guy to gain his affection by not talking about myself only him and his interests (which is actually called being "fun"), and refraining from talking about deep subjects like "politics and drama" (I wonder if this includes checking to see if he can spell potato correctly?).  Let's not forget the main point of the article: "And to be the girl that your man would desire and want, learn to mix a bit of dumb and smart. As long as you earn his love, respect and appreciation for the person you are, you’ll always have a perfectly happy relationship."  Basically, remember your place as a simpering dolt with a nice rack, a smile plastered on your face, and an inability to do things independently.
I plan on reviewing some of the writing form the 'Men" section in the future.  A brief glance has confirmed that it's full of chauvinistic, idealized, power inequity supporting drivel such as Do Girls Like Shy Guys Who Don't Make a Bold Move? ummm, no, because shy guys are weak and have nothing to offer women, geez.  How to Hookup with A Girl and Makeout with Her: find a friend you like, pretend to get drunk with her and then have sex, nothing could be easier!

Information is a vital component to healthy expressions of sexuality, and an exchange of ideas is a good thing.  Despite this, to try and shroud healthy sexuality in unbalanced, poorly informed, pop advice under the guise of "Better Love and Relationships" is irresponsible and highly damaging.  Perspectives such as lovepanky.com create a warped sense of connection, reinforce unacceptable patterns of violence toward women in relationships (a man's "need" for power and a woman's duty to submit or be punished), and skews what gender labels and identifications mean. 

     

Friday, January 11, 2013

Congratulations Are Not in Order

"I hate children."  Making that statement out loud is one of the quickest ways to send people into a tizzy.  Sometimes the response is funny, most of the time it's annoying.  "How can you not like children?" "Oh, you don't mean that."  "When you have one of your own, you'll feel differently."  Really?  What in the statement, "I hate children" would lead you to believe there is a child anywhere in my future?  And, yes, I can mean that, and I suppose it isn't necessarily the children I hate exclusively, but more so parenting and baby culture.     

Why do we congratulate people for getting pregnant and having a baby?  Tradition, compulsion, good will, stupidity, desperation...?  There is often considerable doting that happens when a pregnancy or birth is announced.  I understand wanting to wish people well and support them in their endeavors; however, when it comes to birthing and parenting culture I think a line has been crossed.

Why I am loath to congratulate people on the birth, or soon-to-be birth, of their child:
  1. The idea that people need to be reinforced and praised for propagating the human race is outdated, puzzling, and ridiculous.  Pregnancy often results by choice, and it is a very natural process in most instances.  It takes no special skill or knowledge to have basic sex, which is actually somewhat concerning if your primary reason for having a child is to help build a strong future for humans.  Sex as a biological function is essentially nature's adult version of a shape sorter; easy, as long as you aren't trying to put the square peg in the round hole.  To compound this, natural selection is being thwarted all over the place with more advanced technology and medicine.  The fittest genes are no longer the only ones surviving.
  2. You could be the worst parent in the history of parenting, or at least a bad parent.  Granted raising children is a big commitment, and undoubtedly a difficult task but the likelihood you are going to be a good parent vs. a bad parent is probably pretty evenly split.  So, congratulating you would be like saying, "Hey, nice job on permanently damaging your kid.  Thanks for keeping me in business."  That seems a bit self-serving, don't you think?
  3. Your child could be the next Justin Beiber.  Enough said.
  4. Choosing not to have children is an equally valid choice, and yet, when one dares utter the phrase "I'm not interested in having children" a bombardment of admonishments, disbelief, and ignorance follows.  No one ever says, "Congratulations on having responsible sexual encounters and not adding to the already overcrowded population of Earth." or "Congratulations on not forcing a child into this world without the proper financial, emotional, and psychological support needed to help them grow."    
I actually don't mind children that much.  At times, I even enjoy having them around.  I don't, however, want my own.  No congratulations, please.

Monday, December 31, 2012

Rita's Rhetoric Rules: Banned Words

Lake Superior State University in Michigan has published its annual list of words to be excommunicated from the English language.  While I agree with every word or derivation of the words presented in this year's list, there are a few more I would add for completeness, namely:
  • Legitimately:  As in, "I legitimately didn't sleep for, like, three days.  Seriously." or "I legitimately wore my bikini for three days."  Oh, thank God.  Illegitimate swimwear use is an unsightly snag in the moral fabric of this country; I'm glad someone is being responsible in their fashion choices.  I'm assuming she meant that she was wearing both the top and the bottom in the correct order, right side out.   
  • Incentivize:  I am incentivized to see this word utterly obliterated from common parlance due to its moronic, jargon tinged sound when spoken.  After reading 140, 10-15 page papers with this word popping up four times per page on average, I refuse to acknowledge its continued existence.
  • Thus:  Of all the transitional words or phrases that might be used, "thus" somehow comes out on top?  To counter its ubiquitous existence and make things interesting, I am going to start randomly replacing "thus" with names such as Mabel, Agnes, and Mortimer. 
  • Erstwhile:  I have yet to see this word followed by something other than "writer" or "artist".   I've deduced that people who use "erstwhile" when referring to themselves really mean they are failed writers or artists, not simply that they were a writer or artist at one time, as the actual connotation would indicate.  Keep trying, sweetie, the internet is great for supporting delusions of grandeur.
     Englebert ends my legitimate list of words to be expunged from the English language.  I can now work toward regaining my erstwhile sanity.        
   



Friday, December 28, 2012

The Slave of Slaves: Women

The following is a piece I wrote in August, 2009.  It continues to be relevant to me, especially after reading this article today about the rape, beating, and subsequent death of a 23 year-old Indian woman.  Sadly, not much has changed in three years.        

The Slave of Slaves: Women

A facebook friend posted this article on her page.  The author, Bob Herbert, writes about the effect misogyny has on women and girls as well as the violence associated with it.  The main source of his discussion is around George Sodini, a man in Pennsylvania who shot and killed three women while wounding nine others.

Mr. Herbert's article notes that "A girl or woman somewhere in the U.S. is sexually assaulted every couple of minutes or so. The number of seriously battered wives and girlfriends is far beyond the ability of any agency to count."  This particular statement raises a few questions: how can this be happening with such frequency (and if they are unable to keep accurate counts of women and girls who find themselves in such situations, the notion that the frequency increases in almost unbearable) also, what are the issues surrounding accurate reporting of such crimes and what is being done about the inaccuracy (or the inability or unwillingness on the part of the victim to make a report)?  From January to August of this year (2009), eight women in Minnesota have been murdered as a result of domestic violence.  That is one violent female death per month for the year to date; I find that disturbing, in many ways.  I find that it makes me angry as well.   Herbert alludes to the male need for demonstrable manliness as the reason for such drastic action and unfathomable violence.

This manliness issue is involved, very deep, and indubitably it has many factors.  Herbert quotes the perpetrator of the Pennsylvania shootings as offering this as part of his reasoning: "It seems many teenage girls have sex frequently. One 16 year old does it usually three times a day with her boyfriend. So, err, after a month of that, this little [expletive] has had more sex than ME in my LIFE, and I am 48. One more reason.”  Sex; it's unbelievable in so many ways.  I personally find the idea that women deserve to be punished or killed because of their own sexual liberation to be complete, utterly antiquated, unenlightened idiocy.  That is not to say that I support having copious amounts of high risk sex but we should be able to decide with whom we have sex, when, how, and how frequently.  What brings about this particular sentiment, that women should be sexually inhibited and prudish, is of interest to me though.  The thought that women owe men sex or are only around for sex is laughable, ludicrous in the actual sense of the word.  Also, the idea that it is the woman's fault if a man has a bad sexual experience is equally ridiculous (although in some instances it may be accurate).  Part of this is propagated by popular media and current social practices e.g. pornography and unrealistic body image conceptualizations.

Herbert attempts to make the connection between pornography and violence.  While there may be associations between certain types of pornography and higher instances of violence, to make causal inferences from such a connection is not possible, or useful.  Most people who know me are familiar with my ultra-liberal opinion on sexual health so my unwillingness to completely decry all pornography is not surprising.  However, I think there is something worth considering in the argument that men are socialized into believing that women should be perfect, especially physically and sexually.  Equally important to this is the perception that women want perfect men, i.e. strong men, both physically and emotionally.  Societal influences (eg. advertisements and general media) have thoroughly distorted, mainly through sexual exploitation, what men and women are really like.  Now, it is all about the fabricated "ideal" and what "real" men and women should be like, and what we should want.  When these "ideals" are not achieved or obtained, it causes serious problems.  The unsatisfactory fulfillment of deep desires must have some effect on a person's thought process (eg. "I dress good, am clean shaven, bathe, touch of cologne- yet 30 million women reject me...", "A man needs a women for confidence" - George Sodini, Pennsylvania gym killer), expectations are highly influential.  I can't, however, support that as a justification or mitigation of murder, even if it helps me understand it to a degree

The most salient point of the article is the that the violence and hate women experience simply for being women is unacceptable, and something needs to be done about it.  However, we can't do anything until people acknowledge its existence and severity.  I would add that a consequence of our failure to acknowledge violence against women adversely impacts men, and it allows violence against men to continue as well under an added level of shame at being beaten up by a girl.    

Interestingly, I found this video on Youtube last week, I think it ties in nicely with this blog.  I suggest watching it and listening to the song lyrics, thinking about what has really changed since 1972-when the song came out, and finally, gauging your own reaction to what is being said.  


Wednesday, December 26, 2012

Family Constants

Visiting my immediate family typically reminds me of a few constants I somehow manage to block out of existence when I am on my own.  The first being, my counseling skills are often no match for interactions with my siblings.  The pretense of being non-judgmental, open, and calm is difficult to maintain when you just want to throttle someone over their flagrant misuse of the words "literally" and "legitimately".  A sub-constant of this is that my siblings have an awe-inspiring ability to get under my skin in ways that make no sense.  This is a professionally useful constant because my brother and sisters push buttons I typically don't know exist; awareness is the ultimate gift for a therapist.  The second constant is that a visit with my family can never be dull.  In fact, some minor catastrophe is a requisite part of any gathering.  For example, when my sister Alisha was to graduate from high school, she was pulled over for speeding 100 yards from the school with something less than 10 minutes until the program started.  Despite being in her cap and gown, the cop was less than sympathetic to her plight.  This leads to the third constant: Dad to the rescue.  This is a newer constant, and it takes the place of an old one: fuck Dad.  Alisha was able to be a part of graduation; Dad charmed to cop into letting him take the ticket.  Ever one to oblige, I supplied the minor catastrophe(s) this go round.  As of yesterday, the car I drive is experiencing the tiny problem that is transmission failure.  Transmission failure + ice-packed, snow covered roads = hitting the ditch (and a small boulder) and spinning out into a meadow off of a somewhat isolated, dirt road.  I did a nice job of not rolling the car, or harming my passengers (with the exception of ceramic snowman filled with M&Ms) but I also did an equally nice job of springing the tire and bending the rear axle...sorry car...and snowman.  Of course, Dad to the rescue in the form of his truck, a tow chain, and most importantly, a golden lab named Sunny.  The fourth constant is the paradox my family creates regarding whether or not I want to stay longer or leave sooner.  I suppose that is one of the perks of having a family like mine, knowing that you could make either choice and it would legitimately be fine.

Today is my last day in the Hills.  This part of the world is partially sunny, snow covered, cold, and slow paced.  Tonight there will be night sledding, a bonfire, and roasted marshmallows.    

Sunny Always Makes Things Better