forked from BUlexlab/PyND
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.R
28 lines (24 loc) · 932 Bytes
/
test.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library("reticulate")
library(dplyr)
# use_virtualenv("naomi")
cnd <- import("pynd")
## nd <- import("calcnd.neighborhood_density_calc")
a <- read.csv("~/naomi/data/signdata (33).csv")
features <- c("SignType.2.0",
"MajorLocation.2.0",
"MinorLocation.2.0",
"SecondMinorLocation",
"Movement.2.0",
"Contact",
"SelectedFingers.2.0",
"Flexion.2.0",
"FlexionChange",
"Spread",
"SpreadChange")
## out <- nd$MinimalPairND(sample_n(a, 100), features)
## out$WriteCSVSs("./output/", "foo")
nbr <- import("pynd.neighbors")
my.nbrs <- nbr$Neighbors(sample_n(a, 100), features)
my.nbrs$WriteCSVs("./output", "foo")
b.nd <- read.csv("./output/foo-nd.csv", stringsAsFactors=FALSE, na.strings=c("NA", ""))
b.nbrs <- read.csv("./output/foo-neighbors.csv", stringsAsFactors=FALSE, na.strings=c("NA", ""))