Git Product home page Git Product logo

Comments (12)

jalvesaq avatar jalvesaq commented on September 16, 2024

Please, send the file by e-mail.

from nvim-r.

tdyoshida avatar tdyoshida commented on September 16, 2024

from nvim-r.

jalvesaq avatar jalvesaq commented on September 16, 2024

There is no attachment. You have to send it directly to my e-mail (jalvesaq at gmail.com), not as a reply to a Github comment.

from nvim-r.

jalvesaq avatar jalvesaq commented on September 16, 2024

The issue was happening when the S4 object had a "label" attribute. Maybe it's fixed on the branch https://github.com/jalvesaq/Nvim-R/tree/S4label but it doesn't seem to be very stable: sometimes, the tree doesn't open...

from nvim-r.

tdyoshida avatar tdyoshida commented on September 16, 2024

@jalvesaq Thanks for your response!
Unfortunately, S4label branch did not solve the problem in my environment.
One thing I noticed is that this S4 object's structure is little strange.

The output of str(promoter) is the same as in the image in the previous post.
Five of the slots (type, by, label, upstream and downstream) are somehow with the "$" prefix instead of "@", although these slots cannot be accessed by "$".

promoter$label
# NULL

promoter@label
# "TSS"

I don't know if this is related issue though.

from nvim-r.

jalvesaq avatar jalvesaq commented on September 16, 2024

I forgot to increase nvimcom version number. It should (imperfectly) work now.

from nvim-r.

tdyoshida avatar tdyoshida commented on September 16, 2024

Now the problem is almost solved. Thanks!

Although it's not a big problem for me, the object looks like this now.
ob_s4

It does not show the five slots (type, by, label, upstream, downstream), and somehow the value in the 'label' slot ('TSS') is shown next to the object name. I can still use str to view these slots.

So far I haven't had seen cases where the tree does not open.

from nvim-r.

jalvesaq avatar jalvesaq commented on September 16, 2024

I don't know much about S4 objects, but nvimcom.c runs only slotNames() and not names(attributes()) to list the elements of a S4 object. The results are different:

slotNames(promoter)
names(attributes(promoter))

All slots are attributes, but not all attributes are also slots. I didn't know about this. The "label" attribute receives special treatment in Nvim-R because they are frequently used as variable labels in data.frames. So, "TSS" is shown as the label of promoter in the Object Browser. The other attributes are ignored.

from nvim-r.

jalvesaq avatar jalvesaq commented on September 16, 2024

Attributes can be accessed with the @ symbol in S4, but not in S3 objects:

dtfrm <- data.frame(xxx = c(1, 2, 2), aaa = c("a", "b", "c"))
attr(dtfrm, "label") <- "The label"
dtfrm@label

from nvim-r.

tdyoshida avatar tdyoshida commented on September 16, 2024

This S4 object slot configuration looks little strange to me.
I'm not very familiar with the S4 object configuration, but at least I've never seen S4 objects like this.
For this object, some of the attributes (e.g. label) are not slots, but still can be accessed by "@".

promoter@label
# "TSS"

Again, your fix is good enough for me, and I appreciate your quick response!

from nvim-r.

jalvesaq avatar jalvesaq commented on September 16, 2024

I did a minor optimization a few minutes ago but I will merge the code into the master branch soon.

from nvim-r.

jalvesaq avatar jalvesaq commented on September 16, 2024

Merged now. Thanks for your contribution!

from nvim-r.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.