1

My apologies if this question is a little rudimentary - I'm intermediately experienced in troubleshooting with R, but this issue is persistent, possibly because I'm a little new to R's spatial packages.

I'm trying to use R to process lidar data. I have a LAS file downloaded from a state website. It loads and works well on ArcGIS, and visualizes well lidarview.com.

I want to be able to not rely on ArcGIS and do all processing and analysis in R. I'm trying to start the process by reading the file, following online instructions using these examples of script:

lasfile <- system.file("extdata", "example.laz", package = "rlas")
#OR
las <- readLAS("files.las")

I get the error "File does not exist"

My script (with the file path a little redacted):

LASfile <- system.file(".../UMBC/UMBC_034.las", "UMBC_034.las", package="rlas")
las <- readLAS(LASfile)

#OR

LASfile <- readLAS(".../UMBC/UMBC_034.las")

I checked the file path thoroughly, no issues I can discern.

Any idea what is going on?

Many thanks!

JRR
  • 3,024
  • 2
  • 13
  • 37
O_Paris
  • 11
  • 1
  • 1
    The code you’ve shown is inconsistent: the “or” parts are incomatible; Did you try actually loading the file specified by `lasfile` in the first code? Does that work? – Konrad Rudolph Sep 06 '21 at 20:51
  • 1
    There is this relatively new [rlas bug](https://github.com/Jean-Romain/rlas/issues/53), that one would think wouldn't come into play upon a pkg example, but some work-arounds are proposed that might prove useful. – Chris Sep 06 '21 at 21:28
  • Please trim your code to make it easier to find your problem. Follow these guidelines to create a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Community Sep 06 '21 at 23:31
  • To clarify, when I run this code: LASfile <- system.file(".../UMBC/UMBC_034.las", "UMBC_034.las", package="rlas") Followed by this code: las <- readLAS(LASfile) I get the "File does not exist" error. This is such a basic problem that I do not know where to start to troubleshoot. Is there something wrong with the system.file code? – O_Paris Sep 07 '21 at 21:15
  • SOLVED - I reinstalled rlas package and things are working as expected now - Thank you Chris! – O_Paris Sep 07 '21 at 21:32
  • The new command is now read.las, as in: las <- rlas::read.las(LASfile) – O_Paris Sep 07 '21 at 21:33

0 Answers0