Git Product home page Git Product logo

Comments (3)

iagomosqueira avatar iagomosqueira commented on August 19, 2024

I see where the problem comes from. From that commit if a single vector of is given, and drop=TRUE, it is taken to be used to select elements along the whole object, for example

x[c(1,4,7,8), drop=TRUE]
[1] 11 22 14 24

The code doing it is at, https://github.com/flr/FLCore/blob/master/R/FLArray.R#L159

This is trying to mimic the behaviour of the array class, where you an do

[email protected][c(1,2,4,5)]
[1] 11 21 22 13

which could not be done in FLQuant.

The confusion only occurs when sub-setting on the first dimension, not on others

x[,1:2, drop=TRUE]
     year
quant  1  2
    1 11 12
    2 21 22

Now, I would like to preserve this new behaviour, as it got added because it was needed, but would also like to find a way for your subsetting needs to work.

Are you trying to select some rows and also convert to an array with less dimensions?

from flcore.

colinpmillar avatar colinpmillar commented on August 19, 2024

I was actually using what ever worked, so probably not a bug at all :)
The behaviour you have now, is what you get with array, so I am quite happy with that - it was more to make you aware that there was a change is how the [] function behaved.
Happy for this to be closed as an isssue

from flcore.

iagomosqueira avatar iagomosqueira commented on August 19, 2024

OK, if you find it too difficult to extract elements from an FLQuant into a plain array let me know and we look at it again

from flcore.

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.