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

new measurev function #5022

Merged
merged 10 commits into from
May 25, 2021
Merged

new measurev function #5022

merged 10 commits into from
May 25, 2021

Conversation

tdhock
Copy link
Member

@tdhock tdhock commented May 24, 2021

This is to address #4998 who suggested a new function measurev (analogous to measure, like setkey and setkeyv).

>      (two.iris = data.table(datasets::iris)[c(1,150)])
   Sepal.Length Sepal.Width Petal.Length Petal.Width   Species
1:          5.1         3.5          1.4         0.2    setosa
2:          5.9         3.0          5.1         1.8 virginica
>      melt(two.iris, measure.vars = measure(part, dim, sep="."))
     Species  part    dim value
1:    setosa Sepal Length   5.1
2: virginica Sepal Length   5.9
3:    setosa Sepal  Width   3.5
4: virginica Sepal  Width   3.0
5:    setosa Petal Length   1.4
6: virginica Petal Length   5.1
7:    setosa Petal  Width   0.2
8: virginica Petal  Width   1.8
>      my.list = list(part=NULL, dim=NULL)
>      melt(two.iris, measure.vars=measurev(my.list, sep="."))
     Species  part    dim value
1:    setosa Sepal Length   5.1
2: virginica Sepal Length   5.9
3:    setosa Sepal  Width   3.5
4: virginica Sepal  Width   3.0
5:    setosa Petal Length   1.4
6: virginica Petal Length   5.1
7:    setosa Petal  Width   0.2
8: virginica Petal  Width   1.8

Internally I refactored measure so that is it just parsing the ... and then calling measurev.

@codecov
Copy link

codecov bot commented May 24, 2021

Codecov Report

Merging #5022 (1d6eb1b) into master (c179b5e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5022   +/-   ##
=======================================
  Coverage   99.47%   99.47%           
=======================================
  Files          75       75           
  Lines       14789    14807   +18     
=======================================
+ Hits        14711    14729   +18     
  Misses         78       78           
Impacted Files Coverage Δ
R/fmelt.R 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c179b5e...1d6eb1b. Read the comment docs.

@mattdowle mattdowle added this to the 1.14.1 milestone May 25, 2021
@mattdowle mattdowle merged commit 77b20ae into master May 25, 2021
@mattdowle mattdowle deleted the measurev branch May 25, 2021 07:23
@tdhock
Copy link
Member Author

tdhock commented May 25, 2021

wow that was fast thanks Matt!

@jangorecki jangorecki modified the milestones: 1.14.9, 1.15.0 Oct 29, 2023
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

Successfully merging this pull request may close these issues.

3 participants