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

Conflict between variable name and field name #78

Closed
eaurele opened this issue Sep 6, 2016 · 2 comments
Closed

Conflict between variable name and field name #78

eaurele opened this issue Sep 6, 2016 · 2 comments

Comments

@eaurele
Copy link

eaurele commented Sep 6, 2016

df <- data.frame(V1 = c("bar", "bar/foo"), foo = 1:2, stringsAsFactors = FALSE)
as.Node(df, pathName = "V1")

causes:
Error in mynode$level : $ operator is invalid for atomic vectors
probably because of variable foo named like field foo

@gluc
Copy link
Owner

gluc commented Sep 7, 2016

That is indeed not possible, as both name and fields are stored in the same environment. I agree that the error message could be a bit more expressive. Also, I had the idea to make this a bit less likely to happen with #66. But I'm still undecided.

Will try to improve the error message.

@gluc
Copy link
Owner

gluc commented Dec 12, 2016

A warning has been added if name conflict occurs.

@gluc gluc closed this as completed Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants