Description Usage Arguments Value Examples
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))
.
1 2 3 4 | # 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.
1 2 3 4 5 6 7 8 9 10 11 12 | ## 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)
|
Warning messages:
1: In normalizePath(as.character(filename)) :
path[1]="myfile.txt": No such file or directory
2: In .subset2(public_bind_env, "initialize")(...) :
No file at file location 'myfile.txt'. Tokenizer will always return NA.
[1] NA
character(0)
character(0)
Warning messages:
1: In normalizePath(as.character(filename)) :
path[1]="myfile.txt": No such file or directory
2: In .subset2(public_bind_env, "initialize")(...) :
No file at file location 'myfile.txt'. Tokenizer will always return NA.
character(0)
Warning messages:
1: In normalizePath(as.character(filename)) :
path[1]="myfile.txt": No such file or directory
2: In .subset2(public_bind_env, "initialize")(...) :
No file at file location 'myfile.txt'. Tokenizer will always return NA.
character(0)
Warning messages:
1: In normalizePath(as.character(filename)) :
path[1]="myfile.txt": No such file or directory
2: In .subset2(public_bind_env, "initialize")(...) :
No file at file location 'myfile.txt'. Tokenizer will always return NA.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.