12.07.2015 Views

Package 'NCmisc' - HEAnet Mirror Service

Package 'NCmisc' - HEAnet Mirror Service

Package 'NCmisc' - HEAnet Mirror Service

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

fakeLines 11Examplesextend.pc(c(2,10),0.25) # extend X symmetricallyextend.pc(c(2:10),0.25) # extend the range of X# the following 3 examples extend X by 1% only in the positive directionextend.pc(c(25000,55000),.01,neg=FALSE) # standard positive extensionextend.pc(c(55000,25000),.01,neg=FALSE) # ranges in reverse order, not swappedextend.pc(c(55000,25000),.01,neg=FALSE,swap=TRUE) # ranges in reverse order, swappedfakeLinesCreate fake text for testing purposesDescriptionReturns randomized input as if reading lines from a file, like ’readLines()’ Can be used to test i/ofunctions, robustness.UsagefakeLines(max.lines = 10, max.chars = 100, pc.space = 0.35, delim = " ",can.null = TRUE)Argumentsmax.linesmax.charspc.spacedelimcan.nullmaxmimum number of fake lines to readmaximum number of characters per linepercentage of randomly generated characters that should be a delimiterwhat should the simulated delimiter be, e.g, a space, comma etc. If you wish notto include such either set the delimiter as "", or set pc.space=0.whether with probability 1/max.lines to return NULL instead of any lines oftext, which simulates an empty file, which for testing purposes you may want tobe able to handleValuea vector of character entries up ’max.chars’ long, or sometimes only NULL if can.null=TRUEAuthor(s)Nicholas CooperExamplesfakeLines() # should produce between zero and ten lines of random text, 35% of which are spaces

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!