# loading data externally
data(mtcars)

# creating a new column 
#1
mtcars[,length(mtcars)+1] = (mtcars[,'hp']/mtcars[,'wt'])
#dim(mtcars)
colnames(mtcars)[length(mtcars)] = "torque"
#mtcars[,c('hp','wt','torque')]
mtcars = mtcars[,-12] #or mtcars[,12] = NULL
#dim(mtcars)

#2
mtcars['turque'] = mtcars['hp']/mtcars['wt']
#dim(mtcars)
#names(mtcars)

#3 hp_squred
mtcars$hp_squred = mtcars$hp**2
#mtcars
#ncol(mtcars)


#creating column with the row names of data frame
mtcars$Model = rownames(mtcars)
#mtcars
rownames(mtcars) = NULL
mtcars

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: