Solved

R-Link data mapping error

  • 30 October 2019
  • 1 reply
  • 77 views

Userlevel 2
Badge +3

Hi Community,

 

I am implementing a feature, which needs connection to R. I have the following code, in which I try to give data to R and run a script.

 

dl::DataTables += {'TimeSeries'};
empty DataMap;
DataMap(dl::dt, dl::idn, dl::cn, dl::dn) += data {
    (TimeSeries, 'lg::S_ActivePeriods', 1, 1) : "period",
    (TimeSeries, 'lg::P_TimeSeries', 2, 0) : "demand"
};

MapName := "TimeSeriesMap";
dl::RemoveDataSourceMapping(MapName);
dl::AddDataSourceMapping( MapName, DataMap,
           dl::DependEmpty, dl::TableAttributesEmpty, dl::ColAttributeEmpty );
dl::ExecScript("source('script.r')",MapName,XA);

 

When dl::AddDataSourceMapping runs, I get the following error message: “Unable to obtain identifier handle for column [period, lg::S_ActivePeriods] in table [TimeSeriesMap, TimeSeries]. I have checked that DataMap contains the right data.

 

 

Any advice is much appreciated. This is my first question in the community, please, don’t be harsh on me. If any further information is needed, I will gladly give it :)

 

Thanks,

Zsolti

icon

Best answer by Zsolt Mihály 31 October 2019, 11:06

View original

1 reply

Userlevel 2
Badge +3

In the meantime, I managed to solve the problem. The data contained in the data map was not in the library interface.

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator