search for: trycon

Displaying 3 results from an estimated 3 matches for "trycon".

2001 Oct 02
1
problem with while loop with next (was RE: file connection, w hile, readLines and browser)
...rt Gentleman' > Cc: r-help (E-mail) > Subject: An example (was RE: [R] file connection, while, readLines and > bro wser) > > > Prof. Gentleman (and R-help), > > Here's an example of what didn't work. I still don't understand why. > > Function: > trycon <- function(file, n) { > f.con <- file(file, open="rt") > on.exit(close(f.con)) > i <- 0 > while( length(readln <- readLines(f.con, 1)) > 0 ) { > x <- unlist(strsplit(readln, " ")) > if(length(x) <= 6 && x[3] == x[4]...
2001 Oct 02
0
An example (was RE: file connection, while, readLines and bro wser)
Prof. Gentleman (and R-help), Here's an example of what didn't work. I still don't understand why. Function: trycon <- function(file, n) { f.con <- file(file, open="rt") on.exit(close(f.con)) i <- 0 while( length(readln <- readLines(f.con, 1)) > 0 ) { x <- unlist(strsplit(readln, " ")) if(length(x) <= 6 && x[3] == x[4]) next i <- i + 1 }...
2001 Oct 02
1
RE: problem with while loop with next
...e, > readLines and > > > bro wser) > > > > > > > > > Prof. Gentleman (and R-help), > > > > > > Here's an example of what didn't work. I still don't > understand why. > > > > > > Function: > > > trycon <- function(file, n) { > > > f.con <- file(file, open="rt") > > > on.exit(close(f.con)) > > > i <- 0 > > > while( length(readln <- readLines(f.con, 1)) > 0 ) { > > > x <- unlist(strsplit(readln, " ")) &gt...