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

Folder starting with a number breaks functionality #3

Open
WurmPeter opened this issue Aug 1, 2024 · 5 comments
Open

Folder starting with a number breaks functionality #3

WurmPeter opened this issue Aug 1, 2024 · 5 comments

Comments

@WurmPeter
Copy link
Contributor

I have created an object via path.chain::path_chain() that doesn't work if folder starts with a number.

AAAA$BBBB$CCCC$... works, but when one folder starts with a number, it stops:
AAAA$1BBB$ (nothing more is shown).

Calling AAAA$1BBB in console causes Error: unexpected numeric constant

@krzjoa
Copy link
Owner

krzjoa commented Aug 2, 2024

@WurmPeter

It's a standard R list's behavior, when you try to access a list element using '$' and its name starts with a number.
Try using the following syntax instead: AAAA$`1BBB$` . Compare it with:

l <- list(`1a`="abc")
print(l$1a) # This one is not going to work
print(l$`1a`)

@WurmPeter
Copy link
Contributor Author

Ah, I see. Thanks for the explanation.

@WurmPeter
Copy link
Contributor Author

WurmPeter commented Aug 2, 2024

@krzjoa sorry for pinging you - don't know if you get notified when an issue is re-opened.

Writing this in console

AAAA$'1BBB '

gives

path_chain 
 root: 1BBB 
 children: 11

That's alright.

But writing this in console

AAAA$'1BBB '$.

gives

[1] "..." (path to AAAA, but should be path to AAAA/1BBB)

Is this again something I did wrong?

@WurmPeter WurmPeter reopened this Aug 2, 2024
@krzjoa
Copy link
Owner

krzjoa commented Oct 8, 2024

@WurmPeter
You probably has been notified, that I finally accepted your PR and submitted the package to CRAN.
I mentioned you as a contributor in the description as well.
BTW, I'm curious if you finally found out, what went wrong in the example you sent me last time?
I cannot see any mistake at first glance.

@WurmPeter
Copy link
Contributor Author

You mean why

AAAA$'1BBB '$.

doesn't give the right result? No clue...

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