I am trying to read the html content of a url using the readLines() function in R. However, I am getting a "incomplete final line found"
warning message as shown below? How can I skip the final line in such a case? Any suggestions would be very much appreciated.
x <- readLines("https://in.finance.yahoo.com/industries/technology")
Warning message:
In readLines("https://in.finance.yahoo.com/industries/technology") :
incomplete final line found on 'https://in.finance.yahoo.com/industries/technology'
Most files are missing an End of Line marker like a new line below, so I would just use warn=FALSE.
cat("abc\ndef\nhij", file="test.txt")
readLines( "test.txt")
# [1] "abc" "def" "hij"
# Warning message:
# In readLines("test.txt") : incomplete final line found on 'test.txt'
readLines( "test.txt", warn=FALSE)
# [1] "abc" "def" "hij"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With