2
텍스트 파일을 R에 업로드하면 텍스트가 잘리고 나옵니다. 정확한 수를 얻을 수 없습니다. 내가 사용해야만하는 또 다른 명령이 있습니까? 그래서 전체 텍스트 파일을 읽습니다.R에있는 텍스트 파일이 R에있는 모든 텍스트를로드하지 못합니다.
library(stringr)
> readr::read_file("Apple_Wikipedia.txt")
[1] "Apple Inc. is an American multinational technology company headquartered in Cupertino, California that designs, develops, and sells consumer electronics, computer software, and online services. The company's hardware products include the iPhone smartphone, the iPad tablet computer, the Mac personal computer, the iPod portable media player, the Apple Watch smartwatch, the Apple TV digital media player, and the HomePod smart speaker. Apple's consumer software includes the macOS and iOS operating systems, the iTunes media player, the Safari web browser, and the iLife and iWork creativity and productivity suites. Its online services include the iTunes Store, the iOS App Store and Mac App Store, Apple Music, and iCloud.\r\nApple was founded by Steve Jobs, Steve Wozniak, and Ronald Wayne in April 1976 to develop and sell personal computers. It was incorporated as Apple Computer, Inc. in January 1977, and sales of its computers saw significant momentum and revenue growth for the company.... <truncated>
> x <- c("Apple","ios", "iphone")
> str_count(x)
[1] 5 3 6