read_strings: read ncount string tokens

Description Usage Arguments Examples

Description

read ncount string tokens

Usage

1
read_strings(count)

Arguments

count

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
 # read ncount string tokens
  read_strings <- function(count) {
	res <- character(count)
    icount <- 0
	while (icount < count) {
	  next_line()
	  tokens <- strsplit(aline, " +", perl=TRUE)[[1]]
	  ntokens <- length(tokens)
	  for (itoken in 2:ntokens) {
	    token <- tokens[itoken]
		res[icount+itoken-1] <- token
	  }
	  icount <- icount + ntokens - 1
	}
	res
  }

conmolfields documentation built on May 2, 2019, 4:18 p.m.