Question: An R command that operates on a dataset called coordinates , and produces a new column called SUM from two other columns called X.VAL and
An R command that operates on a dataset called "coordinates" , and produces a new column called SUM from two other columns called X.VAL and Y.VAL can be written as
coordinates$SUM <- with(coordinates, X.VAL + Y.VAL)
Suppose we had a dataset called "heights.weights" containing the weights (in kg) and the heights (in metres) of a group of people, and we wished to add a column called BMI, which computes the "body mass index", calculated as (weight)/(height ^ 2).
Write an R command to add this new column.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
