Translated takeLine()
This commit is contained in:
parent
7f09e3a867
commit
cc9704489c
4 changed files with 37 additions and 13 deletions
|
|
@ -1533,19 +1533,6 @@ greedyMix <- function(
|
|||
|
||||
# %--------------------------------------------------------------------
|
||||
|
||||
|
||||
# function newline = takeLine(description,width)
|
||||
# %Returns one line from the description: line ends to the first
|
||||
# %space after width:th mark.
|
||||
# newLine = description(1:width);
|
||||
# n = width+1;
|
||||
# while ~isspace(description(n)) & n<length(description)
|
||||
# n = n+1;
|
||||
# end;
|
||||
# newline = description(1:n);
|
||||
|
||||
# %-------------------------------------------------------
|
||||
|
||||
# function dist2 = laskeOsaDist(inds2, dist, ninds)
|
||||
# % Muodostaa dist vektorista osavektorin, joka sis<69>lt<6C><74> yksil<69>iden inds2
|
||||
# % v<>liset et<65>isyydet. ninds=kaikkien yksil<69>iden lukum<75><6D>r?
|
||||
|
|
|
|||
17
R/takeLine.R
Normal file
17
R/takeLine.R
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#' @title Take line
|
||||
#' @description Returns one line from the description.
|
||||
#' @param description description
|
||||
#' @param width width
|
||||
#' @return newline
|
||||
#' @export
|
||||
takeLine <- function(description, width) {
|
||||
# Returns one line from the description: line ends to the first
|
||||
# space after width:th mark.
|
||||
newLine <- description[1:width]
|
||||
n <- width + 1
|
||||
while ((description[n] != " ") & (n < length(description))) {
|
||||
n <- n + 1
|
||||
}
|
||||
newline <- description[1:n]
|
||||
return(newline)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue