R中没有“ usedata()”函数

时间:2019-04-03 12:31:01

标签: r

this blog下面有一个命令:

class BoundedFloat
{
public:
    BoundedFloat(const float v) : Value(v) {}

    // some common methods that use Min and Max
    // prefer to implement in base class rather than in each derived class

    bool withinBounds();
    bool breachedLowerThreshold();
    bool breachedUupperThreshold();


protected:
    const float Min;
    const float Max;
    float Value;
}


bool BoundedFloat::withinBounds()
{
    return ((Value >= Min) && (Value<= Max));
}

bool BoundedFloat::breachedLowerThreshold()
{
    return (Value < Min);
}

bool BoundedFloat::breachedUupperThreshold()
{
    return (Value > Max);
}

class Temperature : public BoundedFloat
{
public:
   Temperature(const float v) : BoundedFloat(v) {}

   // seems wasteful to do this each time, when min and max only need 
   // initialised once per derived class
   // Temperature(const float v) : BoundedFloat(v, -40.0f, 80.0f)

   // statically initialise Temperature's Min and Max in base class here somehow?

private:
    // I know this is wrong, but it indicates the functionality I'm looking for.
    override static float Min;
    override static float Max;
}

运行此代码时,发生错误:

net::io_context ioc;
auto endpoint = ip::basic_endpoint<ip::tcp> 
 (ip::address_v4::loopback(), port_num);
auto socket = ip::tcp::acceptor(ioc, ip::tcp::v4());
std::error_code ec;
socket.bind(endpoint);
socket.listen();
auto ct = ioc.poll_one();
auto tcp_socket = socket.accept();

我搜索了此usedata('gpa') 函数,但找不到。 另外,我尝试了Error: could not find function "usedata" ,但仍然无法加载此数据。

1 个答案:

答案 0 :(得分:0)

我想这是一个自定义函数,可以读取csv文件。 Here作者写道:

  

在此示例中,我们使用一组模拟数据(由我们生成)。的   数据保存在文件gpa.csv中。