2

I have a .xlsx spreadsheet with 2 sheets.

This is a screenshot of the first sheet:

enter image description here

And this is a screenshot of the second sheet. Note that cell A2 is a value:

enter image description here

And this is a screenshot of the second sheet. Note that cell A3 is a formula:

enter image description here

I'm importing the second sheet into R with this code:

library(readxl)
read_excel("~/Desktop/x.xlsx", col_names = TRUE, sheet = "sheet2")

Which gives this warning:

Warning message:
In read_fun(path = path, sheet = sheet, limits = limits, shim = shim,  :
  Expecting numeric in A3 / R3C1: got a date

read_excel is importing cell A3 as a date, but I need A3 to be imported as the value, which is 3. How can I import the value of cell A3?

Cœur
  • 37,241
  • 25
  • 195
  • 267
luciano
  • 13,158
  • 36
  • 90
  • 130
  • try `col_types("numeric")` inside `read.excel("x.xlsx", col_types = c("numeric"), sheet= "Sheet2")` – PKumar Dec 10 '17 at 10:00

0 Answers0