Top "Reshape2" questions

The reshape2 package in R contains functions that allow data to be transformed into more convenient forms.

split characters into two variables in data frame

Let's say I have a vector of variables like this: >variable [1] "A1" "A1" "A1" "A1" "A2" "A2" "A2" "A2" "…

r reshape2
Is it possible to use spread on multiple columns in tidyr similar to dcast?

I have the following dummy data: library(dplyr) library(tidyr) library(reshape2) dt <- expand.grid(Year = 1990:2014, Product=LETTERS[1:8], …

r reshape2 tidyr
Can dcast be used without an aggregate function?

Possible Duplicate: This R reshaping should be simple, but dcast from reshape2 works without a formula where there are no …

r reshape2
Comparing gather (tidyr) to melt (reshape2)

I love the reshape2 package because it made life so doggone easy. Typically Hadley has made improvements in his previous …

r reshape2 tidyr
How to "unmelt" data with reshape r

I have a data frame that I melted using the reshape package that I would like to "un melt". here …

r reshape reshape2
R get rows based on multiple conditions - use dplyr and reshape2

df <- data.frame( exp=c(1,1,2,2), name=c("gene1", "gene2", "gene1", "gene2"), value=c(1,1,3,-1) ) In trying to get …

r conditional filtering dplyr reshape2
reshape vs. reshape2 in R

I am attempting to understand why development had shifted from reshape to reshape2 package. They seem to be functionally the …

r reshape reshape2
dcast error: ‘Aggregation function missing: defaulting to length’

My df looks like this: Id Task Type Freq 3 1 A 2 3 1 B 3 3 2 A 3 3 2 B 0 4 1 A 3 4 1 B 3 4 2 A 1 4 2 B 3 I want to …

r data.table reshape reshape2
How to name each variable using melt

I have a matrix that I want to reform for plotting in ggplo2 using the melt function from reshape2 but …

r reshape2 melt
how to spread or cast multiple values in r

Here is toy data set for this example: data <- data.frame(x=rep(c("red","blue","green"),each=4), …

r casting reshape2 spread