I'm trying to import some data into the R, but no matter what I do, there's always a line with the column names (information for a row I want to skip). This is the table:
However,inR,evenbyjumpingthefirstline,thisinformationcomestogether.
Hereisthecodeforproblemreproducibility:
library(tidyverse)dados<-tribble(~Regiao,~'Obitosfetais',~X1,~X2,~X3,~X4,~Obitos,~X5,~X6,~X7,~X8,NA,2005,2006,2007,2008,2009,2005,2006,2007,2008,2009,"Norte", 2106, 2159, 2038, 2119, 2099, 52815, 52286, 53538, 5507, 57375,
"Nordeste", 6896, 6776, 6479, 6941, 6947, 242303, 248049, 258049, 263198, 267177,
"sudeste", 12356, 11749, 11213, 10962, 10632, 478126, 493358, 493478, 501578, 511492,
"Sul", 3605, 3462, 3251, 3221, 3024, 159760, 163914, 169124, 169337, 174871,
"Centro-Oeste", 1856, 1922, 1781, 1725, 1710, 60573, 62585, 64353, 66641, 68301
)
library(openxlsx)
write.xlsx(dados, "meusdados.xlsx", sheetName = "tipo4")
tipo4 <- xlsx::read.xlsx("meusdados.xlsx", "tipo4", starRow = 2, endRow = 7)