timed.write: Write a message with a time stamp to a file; useful for...

Description Usage Arguments Author(s) Examples

View source: R/timed_write.R

Description

Write a message with a time stamp to a file; useful for creating a script log

Usage

1

Arguments

x

Anything you would like to write to a file

file

Path to a file where to write x

append

TRUE if would like to add to file rather than overwrite it or create a new one

Author(s)

N. F. Grinberg, ng414@medschl.cam.ac.uk

Examples

1
2
3
4
5
6
7
# Write "Start: <time now>" to log_file.txt 
# (overwrite if it exists or create if it doesn't)
timed.write('Start', file = 'log_file.txt', append = FALSE)

# Append "Done: <time now>" to log_file.txt
file.create('log_file.txt')
timed.write('Done', file = 'log_file.txt')

stas-g/funfun documentation built on July 18, 2019, 12:58 p.m.