readTokens | R Documentation |
Tokenizer
up to the end of the underlying file.A comfortable way to read all remaining tokens from a file open through a tokenizer..
A comfortable way to read all lines from a file. Syntactic sugar for readTokens(Tokenizer$new(filename),delims=c(10L,13L))
.
# readTokens(mytok)
# readTokens(Tokenizer$new("myfile.txt"),c("0x20L"))
# readlines("myfile.txt")
tok |
The tokenizer from which to read. |
delims |
The delimiters to use for the remaining tokens. |
filename |
The file to read. |
A vector of strings representing the read tokens.
A vector of strings representing the lines of the file.
## Not run:
tok<-Tokenizer$new("myfile.txt") # create a tokenizer
tok$nextToken() # read some tokens
readTokens(tok,as.integer(charToRaw("+"))) # read the rest of the file, now delimited by "+"
readTokens(Tokenizer$new("myfile.txt")) # read all tokens
readTokens("myfile.txt") # same as above, syntactic sugar
## End(Not run)
## Not run:
readlines("myfile.txt")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.