Learn R Programming

minioclient (version 0.0.6)

mc_head: Display first few lines of an object

Description

The head command returns the first n lines of the object as a string. This can be useful when inspecting the content of a large file (without first having to download and store it on disk locally).

Usage

mc_head(target, n = 10, flags = "")

Value

a character string with the contents of the file

Arguments

target

character string specifying the target directory path.

n

integer number of lines to read from the beginning, by default 10

flags

additional flags to be passed to the cat command. Default is an empty string.

Examples

Run this code
if (FALSE) { # interactive()
# upload a CSV file
install_mc()
tf <- tempfile()
write.csv(iris, tf, row.names = FALSE)
mc_mb("play/iris")
mc_cp(tf, "play/iris/iris.csv")

# read first 13 lines from the CSV (header + 12 rows of data)
read.csv(text = mc_head("play/iris/iris.csv", n = 13))
}

Run the code above in your browser using DataLab