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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!