One possibility:
library(reshape2)
df2 <- melt(df, id.var = "V1")
with(df2, table(V1, value))
# value
# V1 A B C D E F
# File1 1 1 1 0 0 0
# File2 1 1 0 1 0 0
# File3 0 0 0 0 1 1
More Related Contents:
- Convert an upper to lower triangle matrix in r [duplicate]
- Reshaping multiple sets of measurement columns (wide format) into single columns (long format)
- Faster ways to calculate frequencies and cast from long to wide
- How to use Pivot_longer to reshape from wide-type data to long-type data with multiple variables
- dcast warning: ‘Aggregation function missing: defaulting to length’
- Reshaping wide to long with multiple values columns [duplicate]
- Reshape multiple values at once
- Grouped bar plot in ggplot
- Compute mean and standard deviation by group for multiple variables in a data.frame
- melt / reshape in excel using VBA?
- Is it possible to use spread on multiple columns in tidyr similar to dcast? [duplicate]
- how to pivot/unpivot (cast/melt) data frame? [duplicate]
- Tidyr how to spread into count of occurrence [duplicate]
- R: Reshaping Multiple Columns from Long to Wide
- Can dcast be used without an aggregate function? [duplicate]
- how to spread or cast multiple values in r [duplicate]
- can the value.var in dcast be a list or have multiple value variables?
- Reshape a dataframe to long format with multiple sets of measure columns [duplicate]
- R reshape a vector into multiple columns
- Unlisting columns by groups
- Select rows from a data frame based on values in a vector
- How can I plot with 2 different y-axes?
- Select the top N values by group
- How to force R to use a specified factor level as reference in a regression?
- How to delete rows from a data.frame, based on an external list, using R?
- How to resolve spherical geometry failures when joining spatial data
- Extract text after “/” in a data frame column
- Calculate Euclidean distance matrix using a big.matrix object
- Knit one markdown file to two output files
- given value of matrix, getting it’s coordinate