Skip to main content
Solved

R-Link data mapping error

  • October 30, 2019
  • 1 reply
  • 86 views

Forum|alt.badge.img+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

Best answer by Zsolt Mihály

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

1 reply

Forum|alt.badge.img+3
  • Author
  • AIMMS Partner
  • 11 replies
  • Answer
  • October 31, 2019

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



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

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