mc_head | R Documentation |
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).
mc_head(target, n = 10, flags = "")
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 |
a character string with the contents of the file
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.