1.Use a new data frame to extract the flowers (each row is a flower) with Petal Length greater than or equal to 4 in is (5 points). Prompt: use subset and pipeline operation
# subset operation
df = subset(iris,Petal.Length >=4)
library(dplyr)
# pipeline operatio
df = iris %>% filter(Petal.Length >=4 )
2 to count the number of flowers with Petal Length greater than or equal to 4, and use an integer variable to represent the number (3 points).
# table operation
table(df$Species)
##
## setosa versicolor virginica
## 0 39 50
# pipeline operatio
df %>% count(Species)
## Species n
## 1 versicolor 39
## 2 virginica 50
3.Arrange these flowers from large to small according to Petal Length, And use a new data frame to represent all the flowers with Petal Length greater than or equal to 4 (6 points)
# order operation
df = df[order(d