Hello,
I have a workflow to calculate X and Y coordinates using igraph library in R tool. My input file contains project group ID, source, and target.
I would like to calculate the X and Y coordinates within the same group. I thought using a batch macro to filter by group would be the way to do it.
However, this batch macro created many unnecessary duplicated rows - I'm sure I'm doing something wrong.
Does anyone know how to run the macro contains R tool and calculate the X and Y coordinates within the same group?
Sincerely,
Kazumi
Solved! Go to Solution.
Hi there - I'm so sorry but where can you post question? I have a question too but I can't find the post button anywhere.
Go to the "Join the Discussion" from either designer or server tab.
Click "New topic"
Then you can create a question.
When you create a question, you need to label your question before posting it.
Sincerely,
Kazumi
Thank you so much!!
@knozawa Can you post a small sample set of your data as well as your R code? If you can post your macro as well, that would be helpful!
@knozawa I think you need to adjust your action tool to change the simple filter line (you're currently replacing the custom filter which is filled not but not being utilized):
Here is a simpler method to accomplish the same thing: 1) I deleted the control parameter, action tool, and filter from your macro:
2) in the workflow that calls this macro, I would summarize your ID and group by it in the macro:
The control group by is a nice little batch macro feature when you just need to run the data through in groups.
Thank you, @patrick_digan!
Your workflow worked great!
I'm curious why using the action tool to update the ID didn't work correctly.
Sincerely,
knozawa
@knozawa Good question! The filter tool has 2 modes, basic(simple) and custom. When you fill out the basic filter, it automatically copies the text into the custom box, but the custom box isn't actually being used at all other than for display purposes. When your second group of records is sent through the macro, your filter basically looks like this:
You're changing the custom filter, but the basic filter is the one being used. The easiest fix would be to change your action tool to replace the basic filter:
For what it's worth, I exclusively use the custom filter. As an alternative, you could switch your filter tool to custom using the radio buttons and then your existing action tool would be setup correctly:
Custom filters are the way to go :)