How to implement Data Reshaping in R?

Description

To implement the data reshaping using R programming.

  • R Package : reshape
  • R Function : melt() for molting data
  • R Function : cast() for casting the molted
    data.

#Data Reshaping

#Installing required Packages
#install.packages(“reshape”)
library(“reshape”)

#Melt Function
attach(airquality)
View(airquality)
melt_data<-melt(airquality, id=c(“Month”,”Day”))
print(melt_data)

#Cast Function
cast(melt_data)

Leave Comment

Your email address will not be published. Required fields are marked *

clear formSubmit