Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to link global events to nodes #25

Open
meakbiyik opened this issue Apr 18, 2021 · 2 comments
Open

Unable to link global events to nodes #25

meakbiyik opened this issue Apr 18, 2021 · 2 comments
Assignees
Labels
Difficulty: Moderate Expected workload is several weeks. Type: Bug Issue is about an error in existing code that needs fixing.

Comments

@meakbiyik
Copy link

meakbiyik commented Apr 18, 2021

Describe the bug
Defined global attributes (via defineGlobalAttribute method) cannot be linked to the nodes or networks, as both of the versions of linkEvents function expects specific columns that global attributes do not have. For the expected linking to node, the error is:

The events couldn't be added:  Invalid events list:  Missing columns node

Furthermore, does goldfish support using ego effect on factor variables, or do I have to one-hot encode them? Nevertheless the above issue persists for non-character replace vectors.

To Reproduce

nodes <- defineNodes(data.frame(label=c("a","b","c")))
days <- as.POSIXct(c("2020-01-25", "2020-01-26","2020-01-27"))
days_of_week <- weekdays(days)
days_of_week <- defineGlobalAttribute(
       data.frame(time = days, replace = days_of_week)
)
nodes <- linkEvents(
     x = nodes,
     changeEvent = days_of_week,
     attribute = "days_of_week"
)

Desktop (please complete the following information):

  • OS: Windows 10
  • R Version 4.0.3
  • Goldfish Version: latest
@auzaheta auzaheta self-assigned this Apr 20, 2021
@auzaheta auzaheta added Difficulty: Moderate Expected workload is several weeks. Type: Bug Issue is about an error in existing code that needs fixing. labels Apr 20, 2021
@auzaheta
Copy link
Collaborator

The linkEvents behavior is a bug. Hopefully, It'd be fixed soon. A workaround is to define it as a normal node variable.

For factor node variables, you need to use one-hot encoding. Feel free to open a new issue asking for the enhancement.

@meakbiyik
Copy link
Author

@auzaheta thanks for the response, and I will open a new issue for that 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Moderate Expected workload is several weeks. Type: Bug Issue is about an error in existing code that needs fixing.
Projects
None yet
Development

No branches or pull requests

2 participants