将csv中的一行(例如)传输到实际的行名称中

时间:2017-07-18 14:17:22

标签: c++

enter image description here

在这张图片中,您可以看到第一行1 dmin_mu等...

我希望这是我的rownames,而不是我的实际数据。

程序:R-Studio但也是R 3.3.3。

1 个答案:

答案 0 :(得分:0)

尝试使用std::stringstd::getline

std::string first_row;
std::getline(my_data, first_row);
std::string column_header1, column_header2, column_header3, column_header4;
my_data >> column_header1 >> column_header2 >> column_header3 >> column_header4;

你在寻找不同的东西吗?