So here's the data I have -
$`cases-travel-associated`
  Country Total Cases Laboratory-Confirmed Cases Total Deaths
1    Mali           1                          1            1
2 Senegal          1*                         1*            0
3   Total           2                          2            1
 $`cases-localized-transmission`
    Country Total Cases Laboratory-Confirmed Cases Total Deaths
 1       Nigeria         20*                        19*            8
 2         Spain           1                          1            0
 3 United States           4                          4            1
 4         Total          25                         24            9
I wanna remove all the asterisks by using gsub -
> gsub("\\*", "", ebola[,3])
and it returns -
Error in ebola[, 3] : incorrect number of dimensions
I think I know the problem is that the class is list instead of a dataframe, so I can't write "ebola[,3]", but I don't know how to fix this in order to remove all the asterisks. Can someone tell me what I should do?
Thanks a lot!
> dput(ebola)
structure(list(`cases-widespread` = structure(list(Country = structure(1:4, .Label = c("Guinea", 
"Liberia", "Sierra Leone", "Total"), class = "factor"), `Total Cases` = structure(c(2L, 
4L, 3L, 1L), .Label = c("13241", "1760", "4862", "6919"), class = "factor"), 
`Laboratory-Confirmed Cases` = structure(1:4, .Label = c("1479", 
"2514", "4149", "8142"), class = "factor"), `Total Deaths` = structure(c(1L, 
3L, 2L, 4L), .Label = c("1054", "1130", "2766", "4950"), class = "factor")), .Names = c("Country", 
"Total Cases", "Laboratory-Confirmed Cases", "Total Deaths"), row.names = c(NA, 
-4L), class = "data.frame"), `cases-travel-associated` = structure(list(
Country = structure(1:3, .Label = c("Mali", "Senegal", "Total"
), class = "factor"), `Total Cases` = structure(1:3, .Label = c("1", 
"1*", "2"), class = "factor"), `Laboratory-Confirmed Cases` = structure(1:3, .Label = c("1", 
"1*", "2"), class = "factor"), `Total Deaths` = structure(c(2L, 
1L, 2L), .Label = c("0", "1"), class = "factor")), .Names = c("Country", 
"Total Cases", "Laboratory-Confirmed Cases", "Total Deaths"), row.names = c(NA, 
-3L), class = "data.frame"), `cases-localized-transmission` = structure(list(
Country = structure(c(1L, 2L, 4L, 3L), .Label = c("Nigeria", 
"Spain", "Total", "United States"), class = "factor"), `Total Cases` = structure(c(2L, 
1L, 4L, 3L), .Label = c("1", "20*", "25", "4"), class = "factor"), 
`Laboratory-Confirmed Cases` = structure(c(2L, 1L, 4L, 3L
), .Label = c("1", "19*", "24", "4"), class = "factor"), 
`Total Deaths` = structure(c(3L, 1L, 2L, 4L), .Label = c("0", 
"1", "8", "9"), class = "factor")), .Names = c("Country", 
"Total Cases", "Laboratory-Confirmed Cases", "Total Deaths"), row.names = c(NA, 
-4L), class = "data.frame")), .Names = c("cases-widespread", 
"cases-travel-associated", "cases-localized-transmission"))
 
    