read_LA950: Read LA-950 measurement files.

Description Usage Arguments Value Author(s) Examples

View source: R/read_LA950.R

Description

This function reads the ASCII output files to R.

Usage

1
read_LA950(file, version = "8", normalise = TRUE)

Arguments

file

Character value, name of the file to be read, with extension.

version

Character value, file format version. Default is "8".

normalise

Logical value, option to normalise measured class values to the base of 100 percent. Default is TRUE.

Value

list object containing sample ID, grain-size data and metadata.

Author(s)

Michael Dietze

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## uncomment to use or use example data set just below
# ## load example data
# x <- read.LA950(file = "LA950.txt")

## read example data set
data(LA950)

# inspect imported data structure
str(LA950)

# plot grain-size distribution curve
plot(LA950, type = "l", log = "x")

# import all files in a folder and write data to a matrix
#   X <- numeric(0)
#   ID <- numeric(0)
#   files <- list.files()
#   for(i in 1:length(files)) {
#     x <- read.LA950(file = files[i])
#     X <- rbind(X, x$y)
#     ID <- c(ID, x$meta$ID)
#   }
#   colnames(X) <- x$x
#   rownames(X) <- ID  

coffeemuggler/grainsize documentation built on May 24, 2019, 3:06 a.m.