eitsupi on Nostr: I ran into #rstats strange behavior when trying to add active bindings inside a for ...
I ran into #rstats strange behavior when trying to add active bindings inside a for loop.
If `makeActiveBinding` is used inside the for loop, it appears that the last value is assigned for all names.
Could this be a bug in the R's for loop?
Using `lapply` instead of for loop seems to work as expected.
Published at
2024-06-15 16:10:25Event JSON
{
"id": "e22dc10d891ab37c8b44b0ea795bc4e3ec6db9d1f80872cbf9bfbfc7e462039a",
"pubkey": "702baf454cf13ecd65a6a1f0d67108745c78d20ae7b3a9b6284b35a843798c09",
"created_at": 1718467825,
"kind": 1,
"tags": [
[
"proxy",
"https://fosstodon.org/@eitsupi/112621507429957920",
"web"
],
[
"t",
"rstats"
],
[
"imeta",
"url https://cdn.fosstodon.org/media_attachments/files/112/621/501/606/584/090/original/cb4e402ea8c35dbc.png",
"m image/png"
],
[
"proxy",
"https://fosstodon.org/users/eitsupi/statuses/112621507429957920",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://fosstodon.org/users/eitsupi/statuses/112621507429957920",
"pink.momostr"
]
],
"content": "I ran into #rstats strange behavior when trying to add active bindings inside a for loop.\nIf `makeActiveBinding` is used inside the for loop, it appears that the last value is assigned for all names.\nCould this be a bug in the R's for loop?\n\nUsing `lapply` instead of for loop seems to work as expected.\nhttps://cdn.fosstodon.org/media_attachments/files/112/621/501/606/584/090/original/cb4e402ea8c35dbc.png\n",
"sig": "5afd4c6483f322fda48d66066b992eaa0e309f1292b79daebba26562cdc51baeeca572ea92d28827dfce10c536576cc234d517312cecb49153276fd6155384df"
}