# NOT RUN {
LASfile <- system.file("extdata", "example.laz", package="rlas")
las = readLAS(LASfile)
print(las)
print(las@header)
x= 1:30
lasadddata(las, x, "mydata")
print(las) # The las object has a new field called "mydata"
print(las@header) # But the header has not been updated. This new data will not be written
lasaddextrabytes(las, x, "mydata2", "A new data")
print(las) # The las object has a new field called "mydata2"
print(las@header) # The header has not been updated. This new data will be written
# optionally if the data is already in the LAS object you can update the header skipping the
# parameter x
lasaddextrabytes(las, name ="mydata", desc = "Amplitude")
print(las@header)
# }
Run the code above in your browser using DataLab