问题:
我有450多个具有2000多个行的Excel电子表格,并希望提取一个表格,该表格在每个电子表格中的位置稍有不同。我有以下用法,它使用Agrep
来标识表的第一行在哪里。
我想
Ven944<-read.xlsx('test.xlsx', sheetName ='Sheet1')
words<-agrep("Malaria. Casos según Entidades Federales y Semanas Epidemiológicas. ", Ven944)
示例数据:
structure(list(luego.de.la.nueva.erupción.se.han.adquirido.mascarillas..lentes. = structure(c(36L,
38L, 39L, 19L, 32L, 25L, 18L, 48L, 23L, 40L, 27L, 30L, 31L, 46L,
22L, NA, 21L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 20L, 24L,
26L, 28L, 29L, 33L, 34L, 35L, 37L, 41L, 42L, 43L, 44L, 47L, 49L,
45L, 5L, 4L, 3L, 2L, 1L, 7L, 6L, 9L, 8L), .Label = c("10000",
"12000", "14000", "16000", "18000", "2000", "4000", "6000", "8000",
"Amazonas", "Anzoátegui", "Apure", "Aragua", "Barinas", "BolÃvar",
"Carabobo", "Cojedes", "comunicación han sido severamente afectados, sin embargo la ",
"correspondientes, sin embargo, la población en albergues, en su ",
"Delta Amacuro", "Distrito Capital", "Entidades\nFederales",
"Erupción del volcán Tungurahua en Ecuador Informe de ", "Falcón",
"garrafones y acueductos rurales. Cultivos, ganaderÃa y vÃas de ",
"Guárico", "http://www.paho.org/spanish/DD/PED/tungurahuaAug 06.htm).",
"Lara", "Mérida", "MALARIA", "Malaria. Casos según Entidades Federales y Semanas Epidemiológicas.",
"mayorÃa, dispone de agua segura mediante suministro de ", "Miranda",
"Monagas", "Nueva Esparta", "para protección ocular y los insumos necesarios para la atención en ",
"Portuguesa", "salud en los diferentes centros asistenciales. El sistema de agua y ",
"saneamiento esta siendo evaluado por las autoridades ", "Situación, 21 de Agosto del 2006 [on line] disponible en ",
"Sucre", "Táchira", "Trujillo", "Vargas", "Venezuela", "Venezuela, desde la SE 23 hasta la SE 33 de 2.006",
"Yaracuy", "zona sigue siendo accesible. (OPS, Emergencias y Desastres ",
"Zulia"), class = "factor"), NA. = structure(c(NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 9L, 5L, 1L, 2L, 1L, 1L,
1L, 1L, 7L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, 1L,
1L, 1L, 1L, 6L, 8L, NA, NA, NA, NA, NA, NA, NA, NA, NA), .Label = c("0",
"102", "12", "21", "23 24 25 26 27 28 29 30 31 32 33",
"5", "609", "749", "SEMANAS EPIDEMIOLOGICAS"), class = "factor"),
luego.de.la.nueva.erupción.se.han.adquirido.mascarillas..lentes..1 = structure(c(13L,
14L, 15L, 8L, 12L, 10L, 7L, 17L, 9L, 16L, 11L, NA, NA, NA,
NA, NA, 1L, 1L, 1L, 2L, 1L, 1L, 5L, 1L, 1L, 4L, 1L, 1L, 1L,
1L, 1L, 2L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 6L, NA, NA, NA,
NA, NA, NA, NA, NA, NA), .Label = c("0", "2", "29", "4",
"571", "608", "comunicación han sido severamente afectados, sin embargo la ",
"correspondientes, sin embargo, la población en albergues, en su ",
"Erupción del volcán Tungurahua en Ecuador Informe de ",
"garrafones y acueductos rurales. Cultivos, ganaderÃa y vÃas de ",
"http://www.paho.org/spanish/DD/PED/tungurahuaAug 06.htm).",
"mayorÃa, dispone de agua segura mediante suministro de ",
"para protección ocular y los insumos necesarios para la atención en ",
"salud en los diferentes centros asistenciales. El sistema de agua y ",
"saneamiento esta siendo evaluado por las autoridades ",
"Situación, 21 de Agosto del 2006 [on line] disponible en ",
"zona sigue siendo accesible. (OPS, Emergencias y Desastres "
), class = "factor"), NA..1 = structure(c(NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1L, 7L, 1L,
2L, 1L, 1L, 5L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
4L, 1L, 1L, 1L, 1L, 2L, 6L, NA, NA, NA, NA, NA, NA, NA, NA,
NA), .Label = c("0", "1", "15", "22", "473", "512", "NSI"
), class = "factor"), NA..2 = structure(c(NA, NA, NA, NA,
NA, NA, NA, NA, NA, 8L, 7L, NA, NA, NA, NA, NA, 1L, 3L, 1L,
1L, 1L, 1L, 5L, 1L, 1L, 4L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
2L, 1L, 1L, 1L, 1L, 2L, 6L, NA, NA, NA, NA, NA, NA, NA, NA,
NA), .Label = c("0", "1", "126", "4", "453", "585", "http://www.paho.org/spanish/DD/PED/tungurahuaAug 06.htm).",
"Situación, 21 de Agosto del 2006 [on line] disponible en "
), class = "factor"), NA..3 = c(NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 55, 9, 2, 0, 0, 522,
0, 0, 5, 0, 1, 0, 0, 0, 1, 0, 0, 45, 0, 0, 0, 0, 4, 644,
NA, NA, NA, NA, NA, NA, NA, NA, NA), NA..4 = structure(c(NA,
NA, NA, NA, NA, NA, NA, NA, NA, 9L, 8L, NA, NA, NA, NA, NA,
1L, 4L, 1L, 1L, 1L, 1L, 6L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L,
5L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 5L, 7L, NA, NA, NA, NA, NA,
NA, NA, NA, NA), .Label = c("0", "15", "29", "46", "5", "505",
"605", "http://www.paho.org/spanish/DD/PED/tungurahuaAug 06.htm).",
"Situación, 21 de Agosto del 2006 [on line] disponible en "
), class = "factor"), NA..5 = c(NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 42, 0, 0, 0, 0, 508,
0, 0, 5, 0, 0, 0, 0, 0, 6, 0, 0, 43, 0, 0, 0, 0, 7, 611,
NA, NA, NA, NA, NA, NA, NA, NA, NA), NA..6 = structure(c(NA,
NA, NA, NA, NA, NA, NA, NA, NA, 10L, 9L, NA, NA, NA, NA,
NA, 1L, 8L, 1L, 2L, 1L, 1L, 6L, 1L, 1L, 3L, 1L, 1L, 1L, 1L,
1L, 5L, 1L, 1L, 4L, 1L, 1L, 1L, 1L, 1L, 7L, NA, NA, NA, NA,
NA, NA, NA, NA, NA), .Label = c("0", "1", "13", "36", "4",
"518", "659", "87", "http://www.paho.org/spanish/DD/PED/tungurahuaAug 06.htm).",
"Situación, 21 de Agosto del 2006 [on line] disponible en "
), class = "factor"), NA..7 = c(NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 79, 0, 4, 0, 1, 547,
0, 0, 7, 0, 1, 0, 0, 0, 1, 0, 0, 45, 0, 0, 0, 0, 3, 688,
NA, NA, NA, NA, NA, NA, NA, NA, NA), NA..8 = structure(c(NA,
NA, NA, NA, NA, NA, NA, NA, NA, 11L, 10L, NA, NA, NA, NA,
NA, 1L, 3L, 1L, 2L, 1L, 1L, 7L, 1L, 1L, 4L, 1L, 1L, 1L, 1L,
1L, 8L, 1L, 1L, 5L, 1L, 1L, 1L, 1L, 6L, 9L, NA, NA, NA, NA,
NA, NA, NA, NA, NA), .Label = c("0", "1", "102", "31", "45",
"5", "599", "7", "790", "http://www.paho.org/spanish/DD/PED/tungurahuaAug 06.htm).",
"Situación, 21 de Agosto del 2006 [on line] disponible en "
), class = "factor"), NA..9 = c(NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 81, 1, 0, 0, 0, 458,
0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 66, 0, 0, 0, 0, 4, 614,
NA, NA, NA, NA, NA, NA, NA, NA, NA), NA..10 = structure(c(NA,
NA, NA, NA, NA, NA, NA, NA, NA, 5L, 4L, NA, NA, NA, 6L, NA,
3L, 2L, 3L, 3L, 3L, 3L, 2L, 3L, 3L, 2L, 3L, 3L, 3L, 3L, 3L,
2L, 3L, 3L, 1L, 3L, 3L, 3L, 3L, 2L, 2L, NA, NA, NA, NA, NA,
NA, NA, NA, NA), .Label = c("Ascenso", "Descenso", "Estable",
"http://www.paho.org/spanish/DD/PED/tungurahuaAug 06.htm).",
"Situación, 21 de Agosto del 2006 [on line] disponible en ",
"TENDENCIA"), class = "factor")), .Names = c("luego.de.la.nueva.erupción.se.han.adquirido.mascarillas..lentes.",
"NA.", "luego.de.la.nueva.erupción.se.han.adquirido.mascarillas..lentes..1",
"NA..1", "NA..2", "NA..3", "NA..4", "NA..5", "NA..6", "NA..7",
"NA..8", "NA..9", "NA..10"), row.names = c(NA, -50L), class = "data.frame")