0

The "measurements" package should be installed and loaded. My first unit conversion (copied below) worked just fine:

temp_f <- 100
temp_c <- F_to_C(temp_f) 
print(paste(temp_f, "ºF is equivalent to", temp_c, "ºC"))

However, the following conversion will not run:

dist_meters <- 100  
dist_feet <- m_to_ft(dist_meters)

I keep getting the error message:

"Error in m_to_ft(dist_m) : could not find function "m_to_ft""

As far as I can tell I'm writing the code correctly and the package seems to be installed and loaded correctly since it worked on the first conversion.

I have tried changing the capitalization (I had to do this with the first conversion before it ran correctly).

user438383
  • 5,716
  • 8
  • 28
  • 43
Hades
  • 13
  • 3
  • `F_to_C()` nor `m_to_ft()`are part of measurements package, `F_to_C()`must origin from some other library or perhaps from a script you are working with. `measurements` syntax looks like `measurements::conv_unit(100, "m", "ft")`. – margusl Feb 20 '23 at 19:13

1 Answers1

0

I don't think measurements package has m_to_ft(), you can use conv_unit() which converts common units of measurements:

dist_m <- 100
dist_ft <- conv_unit(dist_m, "m", "ft")
print(paste(dist_m, "meters is equivalent to", dist_ft, "feet"))

output:

[1] "100 meters is equivalent to 328.083989501312 feet"
Yas
  • 98
  • 5