The httr::content function uses readr::read_csv when you pass type = "text/csv". You can pass parameters through to read_csv within content and luckily read_csv allows you to define the column types of the csv you're importing.invoice <- content(getdata, type = "text/csv", col_types = cols( Account.external_id__c = col_integer(), Invoice.Amount = col_double(), Invoice.Balance = col_double(), Invoice.CreatedDate = col_datetime(format = "")))通知 Invoice.Balance = col_double().有关更多信息,请参见 vignette("column-types",package ="readr").See vignette("column-types", package = "readr") for more info. 这篇关于httr CSV内容读取为整数而不是双精度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-24 10:57