Question: Debug this function that converts megabytes to gigabytes - what's the issue? mb _ to _ gb = function ( x ) { return (

Debug this function that converts megabytes to gigabytes - what's the issue?
mb_to_gb = function(x){
return(mb*0.001)
}
Debug this function that converts megabytes to gigabytes - what's the issue?
mb_to_gb = function(x){
return(mb*0.001)
}
The formula to convert mb to gb is 0.01*megabytes, not 0.001*megabytes.
R cannot return an expression from a function - it must be an object.
The "=" assignment operator was used to create the function rather than "<-".
The input is x, but the function references an object called mb.

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!