如何使用dplyr从原始数据集中获取一组的最大值以及另一列的相应值。

huangapple go评论51阅读模式
英文:

How to get maxium value of a group and corresponding value from another column of the original dataset using dplyr

问题

Here's a simplified solution to achieve your goal:

library(dplyr)

max_fatality <- fire_data %>%
  group_by(Description.of.fire.accident.scene, Type) %>%
  summarize(Total_fatality = sum(dead)) %>%
  group_by(Type) %>%
  slice(which.max(Total_fatality)) %>%
  ungroup() %>%
  select(Description.of.fire.accident.scene, Type, Total_fatality)

max_fatality

This code does the following:

  1. Groups the data by Description.of.fire.accident.scene and Type.
  2. Calculates the total fatality (Total_fatality) for each combination of scene description and type.
  3. Groups the data by Type and selects the row with the maximum total fatality for each type.
  4. Ungroups the data and selects the desired columns.

This should give you the expected result in a simpler and more concise way.

英文:

I have a dataset which is:

fire_data &lt;- data.frame(Year = c(2022,2022,2022,2022,2022,2022,2022,2022,2022,2022,
2022,2022,2022,2022,2022,2022,2022,2022,2022,2022,2022,2022,
2022,2022,2022,2022,2022,2022,2022,2022,2022,2022,2022,2022,
2022,2022,2022,2022,2022,
2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,
2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,
2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,
2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,
2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,
2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,2020,2020
),
Description.of.fire.accident.scene = c(&quot;factory-industry fire&quot;, 
&quot;factory-industry fire&quot;, &quot;factory-industry fire&quot;, &quot;slum fire&quot;, 
&quot;slum fire&quot;, &quot;slum fire&quot;, &quot;gas distribution pipeline fire&quot;, &quot;gas distribution pipeline fire&quot;, 
&quot;gas distribution pipeline fire&quot;, &quot;gas cylinder fire&quot;, &quot;gas cylinder fire&quot;, 
&quot;gas cylinder fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;, 
&quot;multi-storied building fire&quot;, &quot;multi-storied building fire&quot;, 
&quot;multi-storied building fire&quot;, &quot;other building fire&quot;, &quot;other building fire&quot;, 
&quot;other building fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;, 
&quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;market-haat-bazaar-shop fire&quot;, 
&quot;market-haat-bazaar-shop fire&quot;, &quot;market-haat-bazaar-shop fire&quot;, 
&quot;KPI and govt. institute fire&quot;, &quot;KPI and govt. institute fire&quot;, 
&quot;KPI and govt. institute fire&quot;, &quot;education institute fire&quot;, &quot;education institute fire&quot;, 
&quot;education institute fire&quot;, &quot;other scene fire&quot;, &quot;other scene fire&quot;, 
&quot;other scene fire&quot;, &quot;factory-industry fire&quot;, &quot;factory-industry fire&quot;, 
&quot;factory-industry fire&quot;, &quot;slum fire&quot;, &quot;slum fire&quot;, &quot;slum fire&quot;, 
&quot;gas distribution pipeline fire&quot;, &quot;gas distribution pipeline fire&quot;, 
&quot;gas distribution pipeline fire&quot;, &quot;gas cylinder fire&quot;, &quot;gas cylinder fire&quot;, 
&quot;gas cylinder fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;, 
&quot;multi-storied building fire&quot;, &quot;multi-storied building fire&quot;, 
&quot;multi-storied building fire&quot;, &quot;other building fire&quot;, &quot;other building fire&quot;, 
&quot;other building fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;, 
&quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;market-haat-bazaar-shop fire&quot;, 
&quot;market-haat-bazaar-shop fire&quot;, &quot;market-haat-bazaar-shop fire&quot;, 
&quot;KPI and govt. institute fire&quot;, &quot;KPI and govt. institute fire&quot;, 
&quot;KPI and govt. institute fire&quot;, &quot;education institute fire&quot;, &quot;education institute fire&quot;, 
&quot;education institute fire&quot;, &quot;other scene fire&quot;, &quot;other scene fire&quot;, 
&quot;other scene fire&quot;, &quot;factory-industry fire&quot;, &quot;factory-industry fire&quot;, 
&quot;factory-industry fire&quot;, &quot;slum fire&quot;, &quot;slum fire&quot;, &quot;slum fire&quot;, 
&quot;gas distribution pipeline fire&quot;, &quot;gas distribution pipeline fire&quot;, 
&quot;gas distribution pipeline fire&quot;, &quot;gas cylinder fire&quot;, &quot;gas cylinder fire&quot;, 
&quot;gas cylinder fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;, 
&quot;multi-storied building fire&quot;, &quot;multi-storied building fire&quot;, 
&quot;multi-storied building fire&quot;, &quot;other building fire&quot;, &quot;other building fire&quot;, 
&quot;other building fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;, 
&quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;market-haat-bazaar-shop fire&quot;, 
&quot;market-haat-bazaar-shop fire&quot;, &quot;market-haat-bazaar-shop fire&quot;, 
&quot;KPI and govt. institute fire&quot;, &quot;KPI and govt. institute fire&quot;, 
&quot;KPI and govt. institute fire&quot;, &quot;education institute fire&quot;, &quot;education institute fire&quot;, 
&quot;education institute fire&quot;, &quot;other scene fire&quot;, &quot;other scene fire&quot;, 
&quot;other scene fire&quot;),
Type = c(&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, 
&quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;, &quot;male&quot;, &quot;female&quot;, &quot;fire employee&quot;
),
injured = c(35, 5, 17, 21, 8, 0, 14, 7, 0, 28, 2, 0, 5, 1, 
0, 9, 9, 4, 15, 5, 0, 28, 6, 3, 6, 0, 0, 35, 7, 1, 5, 2, 0, 1, 
2, 0, 101, 20, 5, 70, 39, 0, 5, 5, 0, 62, 29, 0, 59, 16, 0, 3, 
0, 0, 18, 16, 4, 47, 20, 1, 27, 7, 0, 8, 5, 0, 43, 2, 1, 11, 
4, 0, 0, 0, 0, 64, 10, 0, 21, 0, 0, 22, 10, 3, 30, 10, 0, 49, 
18, 0, 5, 0, 0, 10, 5, 5, 27, 20, 2, 20, 8, 0, 0, 4, 0, 24, 1, 
2, 3, 0, 3, 0, 0, 0, 28, 2, 0),
dead = c(47, 3, 13, 2, 4, 0, 
7, 0, 0, 0, 1, 0, 0, 0, 0, 4, 2, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 
2, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0, 57, 85, 0, 1, 1, 0, 1, 1, 
0, 5, 3, 0, 0, 0, 0, 3, 3, 0, 11, 1, 0, 12, 5, 0, 0, 0, 0, 11, 
0, 0, 0, 0, 0, 0, 0, 0, 15, 4, 0, 4, 1, 0, 7, 5, 0, 2, 2, 0, 
6, 0, 0, 1, 0, 0, 1, 2, 0, 3, 1, 0, 9, 89, 0, 5, 0, 0, 5, 4, 
0, 0, 0, 0, 0, 0, 0, 5, 2, 0)
)

My goal is to get a tibble which will show Description.of.the.fire.scene with the total (for all year) maximum number of Death of each Type like this photo.

如何使用dplyr从原始数据集中获取一组的最大值以及另一列的相应值。

Now for the data set given in the link, I at first tried this one:

 max_fatality &lt;- fire_data |&gt;
group_by(Description.of.fire.accident.scene, Type) |&gt;
summarize(
Total_fatality = sum(dead),
) |&gt;
group_by(Type) |&gt;
summarise(max_total_fatality = max(Total_fatality))
max_fatality 

Now this gives me the following tibble:

如何使用dplyr从原始数据集中获取一组的最大值以及另一列的相应值。

which is close to my solution by I want the corresponding Description.of.the.fire.scene also. So with the help of other stackoverflow questions, I improvise:

max_fatality &lt;- fire_data |&gt;
group_by(Description.of.fire.accident.scene, Type) |&gt;
summarize(
Total_fatality = sum(dead),
) |&gt;
group_by(Type) |&gt;
mutate(
fatality_count = max(Total_fatality),
new_value = Description.of.fire.accident.scene[which.max(Total_fatality)])|&gt;
filter(
Total_fatality == fatality_count
) |&gt;
select(1, 2, 4)
max_fatality

This gives me my expected result:
如何使用dplyr从原始数据集中获取一组的最大值以及另一列的相应值。

But I think my solution is very much clunky. Can you suggest me a simple solution.

答案1

得分: 1

以下是翻译好的部分:

"看起来你想要筛选出每个类别类型的最大值"

这段代码应该有效:

library(dplyr)

fire_data |&gt; 
  summarise(max_total_fatality = sum(dead), .by = c(Description.of.fire.accident.scene, Type)) |&gt; 
  filter(max_total_fatality == max(max_total_fatality), .by = Type)
Description.of.fire.accident.scene          Type max_total_fatality
1 factory-industry fire          男性                108
2 factory-industry fire fire employee                 13
3          vehicle fire        女性                 94
英文:

It seems like you're looking to filter out the max for each category type

This code should work:

library(dplyr)
fire_data |&gt; 
summarise(max_total_fatality = sum(dead), .by = c(Description.of.fire.accident.scene, Type)) |&gt; 
filter(max_total_fatality == max(max_total_fatality), .by = Type)
Description.of.fire.accident.scene          Type max_total_fatality
1 factory-industry fire          male                108
2 factory-industry fire fire employee                 13
3          vehicle fire        female                 94

答案2

得分: 0

以下是您要翻译的内容:

"One way could be:
In case of ties you will get more lines per group like the first 3 rows:

library(dplyr)
fire_data %&gt;% 
group_by(Description.of.fire.accident.scene, Type) %&gt;% 
summarise(max_total_fatality = sum(dead)) %&gt;% 
slice_max(max_total_fatality)

data:

Description.of.fire.accident.scene Type max_total_fatality
&lt;chr&gt; &lt;chr&gt; &lt;dbl&gt;
1 KPI and govt. institute fire female 0
2 KPI and govt. institute fire fire employee 0
3 KPI and govt. institute fire male 0
4 boiler fire male 1
5 education institute fire female 0
6 education institute fire fire employee 0
7 education institute fire male 0
8 factory-industry fire male 108
9 gas cylinder fire male 11
10 gas distribution pipeline fire male 10
11 hospital fire male 9
12 market-haat-bazaar-shop fire male 18
13 multi-storied building fire male 8
14 other building fire male 15
15 other scene fire male 25
16 slum fire female 10
17 slum fire male 10
18 vehicle fire female 94
fire_data &lt;- structure(list(year = c(2022, 2022, 2022, 2022, 2022, 2022, 2022,
2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 
2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 
2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 
2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 
2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 
2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 
2021, 2021, 2021, 2021, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 
2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 
2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 
2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020), Description.of.fire.accident.scene = c(&quot;factory-industry fire&quot;,
&quot;factory-industry fire&quot;, &quot;factory-industry fire&quot;, &quot;slum fire&quot;,
&quot;slum fire&quot;, &quot;slum fire&quot;, &quot;gas distribution pipeline fire&quot;, &quot;gas distribution pipeline fire&quot;,
&quot;gas distribution pipeline fire&quot;, &quot;gas cylinder fire&quot;, &quot;gas cylinder fire&quot;,
&quot;gas cylinder fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;,
&quot;multi-storied building fire&quot;, &quot;multi-storied building fire&quot;,
&quot;multi-storied building fire&quot;, &quot;other building fire&quot;, &quot;other building fire&quot;,
&quot;other building fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;,
&quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;market-haat-bazaar-shop fire&quot;,
&quot;market-haat-bazaar-shop fire&quot;, &quot;market-haat-bazaar-shop fire&quot;,
&quot;KPI and govt. institute fire&quot;, &quot;KPI and govt. institute fire&quot;,
&quot;KPI and govt. institute fire&quot;, &quot;education institute fire&quot;, &quot;education institute fire&quot;,
&quot;education institute fire&quot;, &quot;other scene fire&quot;, &quot;other scene fire&quot;,
&quot;other scene fire&quot;, &quot;factory-industry fire&quot;, &quot;factory-industry fire&quot;,
&quot;factory-industry fire&quot;, &quot;slum fire&quot;, &quot;slum fire&quot;, &quot;slum fire&quot;,
&quot;gas distribution pipeline fire&quot;, &quot;gas distribution pipeline fire&quot;,
&quot;gas distribution pipeline fire&quot;, &quot;gas cylinder fire&quot;, &quot;gas cylinder fire&quot;,
&quot;gas cylinder fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;, &quot;boiler fire&quot;,
&quot;multi-storied building fire&quot;, &quot;multi-storied building fire&quot;,
&quot;multi-storied building fire&quot;, &quot;other building fire&quot;, &quot;other building fire&quot;,
&quot;other building fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;, &quot;vehicle fire&quot;,
&quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;hospital fire&quot;, &quot;market-haat-bazaar-shop fire&quot;,
&quot;market-haat-bazaar-shop fire&quot;, &quot;market-haat-bazaar-shop fire&quot;,
&quot;KPI and govt. institute fire&quot;, &quot;KPI and govt. institute fire&quot;,
&quot;KPI and govt. institute fire&quot;, &quot;education institute fire&quot;, &quot;education institute fire&quot;,
&quot;education institute fire&quot;, &quot;other scene fire&quot;, &quot;other scene fire&quot;,
&quot;other scene fire&quot;, &quot;factory-industry fire&quot;, &quot;factory-industry fire&quot;,
&quot;factory-industry fire&quot;, &quot;slum fire&quot;, &quot;slum fire&quot;, &quot;slum fire&quot;,
&quot;gas distribution pipeline fire&quot;, &quot;gas distribution
<details>
<summary>英文:</summary>
One way could be: 
In case of ties you will get more lines per group like the first 3 rows: 

library(dplyr)

fire_data %>%
group_by(Description.of.fire.accident.scene, Type) %>%
summarise(max_total_fatality = sum(dead)) %>%
slice_max(max_total_fatality)

data:

Description.of.fire.accident.scene Type max_total_fatality
<chr> <chr> <dbl>
1 KPI and govt. institute fire female 0
2 KPI and govt. institute fire fire employee 0
3 KPI and govt. institute fire male 0
4 boiler fire male 1
5 education institute fire female 0
6 education institute fire fire employee 0
7 education institute fire male 0
8 factory-industry fire male 108
9 gas cylinder fire male 11
10 gas distribution pipeline fire male 10
11 hospital fire male 9
12 market-haat-bazaar-shop fire male 18
13 multi-storied building fire male 8
14 other building fire male 15
15 other scene fire male 25
16 slum fire female 10
17 slum fire male 10
18 vehicle fire female 94

fire_data <- structure(list(year = c(2022, 2022, 2022, 2022, 2022, 2022, 2022,
2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2021,
2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021,
2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021,
2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021,
2021, 2021, 2021, 2021, 2021, 2020, 2020, 2020, 2020, 2020, 2020,
2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020
), Description.of.fire.accident.scene = c("factory-industry fire",
"factory-industry fire", "factory-industry fire", "slum fire",
"slum fire", "slum fire", "gas distribution pipeline fire", "gas distribution pipeline fire",
"gas distribution pipeline fire", "gas cylinder fire", "gas cylinder fire",
"gas cylinder fire", "boiler fire", "boiler fire", "boiler fire",
"multi-storied building fire", "multi-storied building fire",
"multi-storied building fire", "other building fire", "other building fire",
"other building fire", "vehicle fire", "vehicle fire", "vehicle fire",
"hospital fire", "hospital fire", "hospital fire", "market-haat-bazaar-shop fire",
"market-haat-bazaar-shop fire", "market-haat-bazaar-shop fire",
"KPI and govt. institute fire", "KPI and govt. institute fire",
"KPI and govt. institute fire", "education institute fire", "education institute fire",
"education institute fire", "other scene fire", "other scene fire",
"other scene fire", "factory-industry fire", "factory-industry fire",
"factory-industry fire", "slum fire", "slum fire", "slum fire",
"gas distribution pipeline fire", "gas distribution pipeline fire",
"gas distribution pipeline fire", "gas cylinder fire", "gas cylinder fire",
"gas cylinder fire", "boiler fire", "boiler fire", "boiler fire",
"multi-storied building fire", "multi-storied building fire",
"multi-storied building fire", "other building fire", "other building fire",
"other building fire", "vehicle fire", "vehicle fire", "vehicle fire",
"hospital fire", "hospital fire", "hospital fire", "market-haat-bazaar-shop fire",
"market-haat-bazaar-shop fire", "market-haat-bazaar-shop fire",
"KPI and govt. institute fire", "KPI and govt. institute fire",
"KPI and govt. institute fire", "education institute fire", "education institute fire",
"education institute fire", "other scene fire", "other scene fire",
"other scene fire", "factory-industry fire", "factory-industry fire",
"factory-industry fire", "slum fire", "slum fire", "slum fire",
"gas distribution pipeline fire", "gas distribution pipeline fire",
"gas distribution pipeline fire", "gas cylinder fire", "gas cylinder fire",
"gas cylinder fire", "boiler fire", "boiler fire", "boiler fire",
"multi-storied building fire", "multi-storied building fire",
"multi-storied building fire", "other building fire", "other building fire",
"other building fire", "vehicle fire", "vehicle fire", "vehicle fire",
"hospital fire", "hospital fire", "hospital fire", "market-haat-bazaar-shop fire",
"market-haat-bazaar-shop fire", "market-haat-bazaar-shop fire",
"KPI and govt. institute fire", "KPI and govt. institute fire",
"KPI and govt. institute fire", "education institute fire", "education institute fire",
"education institute fire", "other scene fire", "other scene fire",
"other scene fire"), Type = c("male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee",
"male", "female", "fire employee", "male", "female", "fire employee"
), injured = c(35, 5, 17, 21, 8, 0, 14, 7, 0, 28, 2, 0, 5, 1,
0, 9, 9, 4, 15, 5, 0, 28, 6, 3, 6, 0, 0, 35, 7, 1, 5, 2, 0, 1,
2, 0, 101, 20, 5, 70, 39, 0, 5, 5, 0, 62, 29, 0, 59, 16, 0, 3,
0, 0, 18, 16, 4, 47, 20, 1, 27, 7, 0, 8, 5, 0, 43, 2, 1, 11,
4, 0, 0, 0, 0, 64, 10, 0, 21, 0, 0, 22, 10, 3, 30, 10, 0, 49,
18, 0, 5, 0, 0, 10, 5, 5, 27, 20, 2, 20, 8, 0, 0, 4, 0, 24, 1,
2, 3, 0, 3, 0, 0, 0, 28, 2, 0), dead = c(47, 3, 13, 2, 4, 0,
7, 0, 0, 0, 1, 0, 0, 0, 0, 4, 2, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0,
2, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0, 57, 85, 0, 1, 1, 0, 1, 1,
0, 5, 3, 0, 0, 0, 0, 3, 3, 0, 11, 1, 0, 12, 5, 0, 0, 0, 0, 11,
0, 0, 0, 0, 0, 0, 0, 0, 15, 4, 0, 4, 1, 0, 7, 5, 0, 2, 2, 0,
6, 0, 0, 1, 0, 0, 1, 2, 0, 3, 1, 0, 9, 89, 0, 5, 0, 0, 5, 4,
0, 0, 0, 0, 0, 0, 0, 5, 2, 0)), row.names = c(NA, -117L), spec = structure(list(
cols = list(year = structure(list(), class = c("collector_double",
"collector")), Description.of.fire.accident.scene = structure(list(), class = c("collector_character",
"collector")), Type = structure(list(), class = c("collector_character",
"collector")), injured = structure(list(), class = c("collector_double",
"collector")), dead = structure(list(), class = c("collector_double",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), delim = ","), class = "col_spec"), problems = <pointer: 0x0000026ef8a79610>, class = c("spec_tbl_df",
"tbl_df", "tbl", "data.frame"))


</details>

huangapple
  • 本文由 发表于 2023年5月22日 00:08:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76300795.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定