Improved validation
This commit is contained in:
parent
88fc203c3d
commit
2f809d01df
1 changed files with 6 additions and 0 deletions
|
|
@ -4,6 +4,12 @@
|
|||
#' @return nimi
|
||||
#' @export
|
||||
lueNimi <- function(line) {
|
||||
# ==========================================================================
|
||||
# Validation
|
||||
# ==========================================================================
|
||||
if (!grepl(",", line)) {
|
||||
stop("There are no commas in this line")
|
||||
}
|
||||
# Palauttaa line:n alusta sen osan, joka on ennen pilkkua.
|
||||
n <- 1
|
||||
merkki <- substring(line, n, n)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue