0

I ran the below code and have been getting this error.

code I ran -

headers <- read.csv(file.choose(), skip = 1, header = F, nrows = 1, as.is = T)

D_Lib: debug printing for files [.*] and level [100] is turned on
D_Lib: debug printing for files [.*] and level [200] is turned on
D_Lib: debug printing for files [.*] and level [300] is turned on
Error in header + nrows : non-numeric argument to binary operator

Any suggestions on how to resolve this. I donot have a programming background and I am a beginner in R.

Thanks,

NKHH
  • 13
  • 2
  • It looks like you are trying to read in only 1 row of data, but also skipping the first row which implies you are not importing any rows. – SteveM Dec 07 '20 at 23:34
  • 1
    @SteveM Incorrect: `skip=` controls how many rows are skipped, default to zero; `nrows` controls how many rows are read after the appropriate number of rows (if any) are skipped. With `(skip=1,nrows=1)`, it reads the second line of the file. – r2evans Dec 08 '20 at 00:34
  • @r2evans. Thanks for the clarification. – SteveM Dec 08 '20 at 00:43
  • This is likely related to `file.choose()` using the native file dialog, and some ViewFinity (now CyberArk) "security" product installed. Compare https://stackoverflow.com/q/32056783/, https://stackoverflow.com/q/43979346/, https://social.microsoft.com/Forums/en-US/41b6ab50-04ae-4353-93c1-a0984485a8fb/ – bers Sep 14 '22 at 14:17

0 Answers0