我有一个带有分类变量(CHR,22个级别)和连续变量(POS,用于染色体位置,在CHR水平之间变化)的数据帧(df)。我想根据POS的范围生成一个额外的分类变量,必须根据每个CHR级别的POS值生成,并且范围大小相同,例如,让我们假设这是df:< / p>
#include <Windows.h>
#include <iostream>
#include <vector>
std::vector<int> Base::m_intList;
class Base
{
public:
Base();
protected:
static std::vector<int> m_intList;
};
class Derived : Base
{
public:
Derived();
protected:
bool fWhatever;
};
class MoreDerived : Derived
{
public:
MoreDerived();
private:
HRESULT DoStuff();
};
Base::Base()
{
}
Derived::Derived()
{
}
MoreDerived::MoreDerived()
{
}
HRESULT MoreDerived::DoStuff()
{
for (auto it = m_intList.begin(); it != m_intList.end(); it++)
{
std::cout << *it;
}
}
所以我尝试使用以下方法首先拆分df:
CHR POS
1 2
1 4
1 6
. .
. .
1 30
. .
. .
. .
22 150
22 162
22 170
22 185
问题是切割功能不起作用 谢谢你的帮助!