powered by
getsingle splits up a text line and translates the first non-empty character string into a number.
getsingle(inline, sep = ",")
the line of text, usually taken after using readLines
the separator used to divide the numbers from descriptive text, defaults to a comma.
a single number
# NOT RUN { x <- "12.3 , this is a number" y <- "21.3 # 22.3 # here are two numbers" getsingle(x) getsingle(y,sep="#") getsingle(y) # be sure to get the separator correct # }
Run the code above in your browser using DataLab