Reads CSVY, print YAML and fread file.
See also
Other helpers:
fex()
,
obs_footname()
,
obs_format()
,
obs_freq()
,
obs_list.dt()
,
obs_out()
,
obs_rbind()
,
obs_roundtime()
,
obs_trunc()
,
obs_write_csvy()
,
rtorf-deprecated
,
sr()
Examples
{
df <- data.frame(a = rnorm(n = 10),
time = Sys.time() + 1:10)
f <- paste0(tempfile(), ".csvy")
notes <- c("notes",
"more notes")
obs_write_csvy(dt = df, notes = notes, out = f)
s <- obs_read_csvy(f)
s
# or
readLines(f)
data.table::fread(f)
}
#> [1] "---"
#> [2] "name: Metadata "
#> [3] "notes"
#> [4] "more notes"
#> [5] "structure: "
#> [6] "'data.frame':\t10 obs. of 2 variables:"
#> [7] " $ a : num -1.4 0.255 ..."
#> [8] " $ time: POSIXct, format: \"2025-04-01 17:30:50\" ..."
#> [9] "NULL"
#> [10] "---"
#> a time
#> <num> <POSc>
#> 1: -1.400043517 2025-04-01 17:30:50
#> 2: 0.255317055 2025-04-01 17:30:51
#> 3: -2.437263611 2025-04-01 17:30:52
#> 4: -0.005571287 2025-04-01 17:30:53
#> 5: 0.621552721 2025-04-01 17:30:54
#> 6: 1.148411606 2025-04-01 17:30:55
#> 7: -1.821817661 2025-04-01 17:30:56
#> 8: -0.247325302 2025-04-01 17:30:57
#> 9: -0.244199607 2025-04-01 17:30:58
#> 10: -0.282705449 2025-04-01 17:30:59