Utility {psych} | R Documentation |
Wrappers for dirname, file.choose, readLines. file.create, file.path to be called directly for listing directories, creating files, showing the files in a directory, and listing the content of files in a directory. fileCreate
gives the functionality of file.choose
(new=TRUE). filesList
combines file.choose, dirname, and list.files to show the files in a directory, fileScan
extends this and then returns the first few lines of each readable file
fileScan(f = NULL, nlines = 3, max = NULL, from = 1, filter = NULL) filesList(f=NULL) filesInfo(f=NULL,max=NULL) fileCreate(newName="new.file")
f |
File path to use as base path (will use file.choose() if missing. If f is a directory, will list the files in that directory, if f is a file, will find the directory for that file and then list all of those files.) |
nlines |
How many lines to display |
max |
maximum number of files to display |
from |
First file (number) to display |
filter |
Just display files with "filter" in the name |
newName |
The name of the file to be created. |
Just a collection of simple wrappers to powerful core R functions. Allows the user more direct control of what directory to list, to create a file, or to display the content of files. The functions called include file.choose
, file.path
, file.info
,file.create
, dirname
, and dir.exists
. All of these are very powerful functions, but not easy to call interactively.
Work arounds for core-R functions for interactive file manipulation
William Revelle
read.file
to read in data from a file or read.clipboard
from the clipboard. dfOrder
to sort data.frames.
#all of these require interactive input and thus are not given as examples #fileCreate("my.new.file.txt") #filesList() #choose the items in the directory where a file is displayed #fileScan() #show the content of the files in a director #or, if you have a file in mind # f <- file.choose() #go find it #filesList(f) #fileScan(f)