Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Transforming dataset

$
0
0

@ambergupta wrote:

Am learning stats and R . Here a data manipulation question which I am not able to figure out how to do it in R. Here is dataframe output

head(mydata)
Coast Menu Sales
1 East Item1 25
2 East Item1 36
3 East Item1 31
4 East Item1 26
5 East Item2 39
6 East Item2 42

I want to convert into dataset with columns ( Item1, Item2...) and rows as (East, West ...) and Sales data fitted into this matrix.

I tried using melt and cast but not successful.
What could be efficient code to perform this transformation?

Regards
Amber

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles