From the mtcars data, create a separate column called ‘Performance’ which will contain the ratios of HP and WT of the cars.

817    Asked by Daminidas in Data Science , Asked on Nov 12, 2019
Answered by Damini das

Let us call the data frame mtcars

head(mtcars)


Now let us create an extra column called ‘performance’ using a function called mutate() from dplyr library

head(mutate(mtcars,Performance=hp/wt))





Your Answer

Interviews

Parent Categories