r - 根据行标签检索对应的列值
问题描述
所以我在excel中有一组数据:
StudID Score Participation
100 54 0.43
432 70 0.65
321 98 0.96
100 65 0.55
我将其读入 R:
stud_stat <- read.csv("student.csv")
我现在要做的是仅根据特定 ID 检索分数和参与值。例如,如果 ID 是 100,我会想要:
StudID Score Participation
100 54 0.43
100 65 0.55
我做了类似的事情:
find <- stud_stat[which(stud_stat$StudID == "100")]
我收到一个错误,提到undefined columns selected。
解决方案
推荐阅读
- c - GStreamer:根据条件将数据写入文件的管道
- c# - 在 wpf .net 核心应用程序中以应用程序为中心的 StackPanel 的特定元素
- arrays - 根据id重新排列php多维数组
- c# - 集成 OpenAPI / Swagger 时出现命令“dotnet ...”错误
- javascript - 如何选择具有三元条件的默认下拉选项?
- r - 具有可变治疗交互作用的每个治疗组的 C 指数
- bash - 带有数组的 Bash 脚本
- php - 后台进程在 5 分钟后停止 - PHP 和 WordPress
- file - 在 Angular 9 中单击链接时下载文件?
- android - 如何使用android studio创建平板电脑背景