Open choiseongkuan opened 1 year ago
收到
so nervous, are there any bro here?
有
我們集中一個貼不
壯壯說,老師說考試很簡單
大家信不
我們不是都說好集中在這了咩
Ok
我們還在分配座位
我開始了
我先干了4,5,6吧
我換課室了
不會做,我做789吧
我剛剛上傳了卷子的截圖了
我先看一的123吧那
我刚刚做完第一题编程题了
你是從第三大題第一題開始做嗎
对
煩
這女的走來走去的
開GPT很醒目
我這没人走
需要我开gpt帮忙查什么吗
8. library(nycflights13)
flights_no_missing <- flights[!is.na(flights$dep_delay),]
flights_january <- subset(flights_no_missing, month == 1)
delayed_flights <- subset(flights_january, dep_delay > 0) proportion_delayed <- nrow(delayed_flights) / nrow(flights_january)
print(round(proportion_delayed, 3))
9. library(nycflights13)
flights_20130608 <- subset(flights, year == 2013 & month == 6 & day == 8)
no_flight_planes <- subset(planes, !(tailnum %in% flights_20130608$tailnum))
num_no_flight_planes <- nrow(no_flight_planes)
print(num_no_flight_planes)
10 library(nycflights13)
longest_flights <- subset(flights, distance == max(flights$distance))
unique_tailnums <- unique(longest_flights$tailnum) num_unique_tailnums <- length(unique_tailnums)
print(num_unique_tailnums)
可複製到自己那試試
编程题1-3题上传了,大家注意检查验证正确性,可以把代码发给gpt让gpt解释代码,看看是否合理
完力
第一part 4. color_names <- colors()
same_start_end <- sum(substr(color_names, 1, 1) == substr(color_names, nchar(color_names), nchar(color_names)))
print(same_start_end)
可複製到自己那試試
好的老師,有空試下第二部分唄~
好!
完了,那个编程题第四题我看不懂
1-1. length(unique(iris$Species)) 1-3. sdprice <- sd(diamonds$price)
我只會這些
老師把有的發一下
喔發了啊
第四题也上传了,但是我没看懂题目意思,仅供参考😣
老師,第一part的2 3 5 6
qwq
第一part第2题 `set.seed(123) test_list <- list(a = sample(-100:100, 100, replace = FALSE), b = "R test list", c = list(runif(50)))
mean_diff <- round(mean(test_list$a) - mean(unlist(test_list$c)), 3)
` 结果是2.397
第一part第3题
library(dplyr)
diamonds %>%
group_by(cut) %>%
summarize(sd_price = sd(price))
结果如图
第一part第5题
library(datasets)
data(economics)
economics$pce_diff <- c(NA, diff(economics$pce))
max_date <- economics$date[which.max(economics$pce_diff)]
cat("人们的消费支出(pce)相比上一日期最大增长发生在:", max_date, "\n")
结果11596(答案错误,请看下面的修正)
第一part第6题
library(ggplot2)
data(iris)
ggplot(iris, aes(x = Sepal.Length, y = Petal.Length, color = Species)) +
geom_point() +
labs(x = "Sepal Length", y = "Petal Length")
答案是 setosa
5怪怪的
這答案是日期嗎
更正!答案为图片右侧的max_date
能發碼嗎
没時間了'
什么码
有二大題嗎
明天:我婷貓先寫填空題,你先寫編程