Skip to content
Back to formatted view

Raw Message

Message-ID: <0EFBC7C31DB4F24F8CAC48136A1762D7018DAE97A76A@MAIL2.rose.portland.local>
Date: 2014-02-19T21:09:46Z
From: Law, Jason
Subject: Change data format query
In-Reply-To: <etPan.5304cb31.4e6afb66.f7@Marks-MacBook-Pro.local>

library(reshape2)
data.melt <- melt(data, id.vars = c('BH_ID', 'BH_Name', 'Pack_Name')) 
dcast(dm, BH_Name ~ Pack_Name)


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of drruddy gmail
Sent: Wednesday, February 19, 2014 7:18 AM
To: r-help at r-project.org
Subject: [R] Change data format query


# Data manipulation problem #

Please my Git repo at <https://github.com/markruddy/RAD.git>

Running RStudio 0.97.248

The dataset RYA13Report_transect_AB.csv is in a sort of 'longform' at the moment. Which I would like to change so that:

1. Each Pack_Name is a column
2. Each BH_Name is a row
3. Top-mOD are variables of Pack_Name

I've played around with reshape but can't fathom it out.??

Any help appreciated.

Mark

	[[alternative HTML version deleted]]