USCbiostats / partition

A fast and flexible framework for data reduction in R
https://uscbiostats.github.io/partition/
Other
34 stars 5 forks source link

part_kmeans() error #1

Closed millstei closed 5 years ago

millstei commented 5 years ago

Error from small threshold:

prt = partition( .data=x, threshold=.6, partitioner = part_kmeans() ) prt = partition( .data=x, threshold=.2, partitioner = part_kmeans() ) Error in reduce_partition_c(.data, df = .data, assign_partition = assign_partition, : Evaluation error: 'x' must be an array of at least two dimensions.

malcolmbarrett commented 5 years ago

This turned out to be the same bug as you had before; data frames coerce to a vector when a single column is subset using df[, i], a default that drives me bananas. I've found all the places I do this and replaced with df[, i, drop = FALSE] to make it consistent, so this should now be truly resolved

millstei commented 5 years ago

Great. I will reinstall.

Josh


From: Malcolm Barrett notifications@github.com Sent: Thursday, May 2, 2019 9:49:56 AM To: malcolmbarrett/partition2 Cc: Joshua Millstein; Author Subject: Re: [malcolmbarrett/partition2] part_kmeans() error (#1)

This turned out to be the same bug as you had before; data frames coerce to a vector when a single column is subset using df[, i], a default that drives me bananas. I've found all the places I do this and replaced with df[, i, drop = FALSE] to make it consistent, so this should now be truly resolved

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_malcolmbarrett_partition2_issues_1-23issuecomment-2D488747672&d=DwMFaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=5BORHoQYE9w2BHZNTcSvXLhGafxYZxC6tuYqXha0jeA&m=9w-iW7wMVFyWwTeXkkYIIv6s6iehkiUAZMe-RG9tgG4&s=F8g7BWMNeJKY1SFVwA92CEVU18XZvXlJ_q7bg7iFERo&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AFQJR4BT6LCP3N23LJRQFEDPTMLTJANCNFSM4HJ7Y67A&d=DwMFaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=5BORHoQYE9w2BHZNTcSvXLhGafxYZxC6tuYqXha0jeA&m=9w-iW7wMVFyWwTeXkkYIIv6s6iehkiUAZMe-RG9tgG4&s=maJZIvl-7bsQJgZgxJAdfWGSDz7UxWUw8zXvIujKRH8&e=.