Comments (5)
I was unable to recreate this in a minimum example comparing round
to rCompare
with roundDigits
# Create two random variables ; b is equal to a with noise added
a <- runif(100)
b <- a + runif(100)*1E-8
# Do they match?
sum(a==b) # 0
for(i in 1:10) {
mtch <- sum(round(a,i) == round(b,i))
print(paste0("i = ", i, " : matches = ", mtch))
}
library(dataCompareR)
dfa <- as.data.frame(a)
dfb <- as.data.frame(b)
names(dfa) <- "COL1"
names(dfb) <- "COL1"
for(i in 1:10) {
rcmp <- rCompare(dfa, dfb, roundDigits = i)
mtchs <- if(is.null(nrow(rcmp$mismatches$COL1))) {
100
} else {
100 - nrow(rcmp$mismatches$COL1)
}
print(paste0("datacomp : i = ", i, " : matches = ", mtchs))
}
}
Which produces
[1] "i = 1 : matches = 100"
[1] "i = 2 : matches = 100"
[1] "i = 3 : matches = 100"
[1] "i = 4 : matches = 100"
[1] "i = 5 : matches = 100"
[1] "i = 6 : matches = 100"
[1] "i = 7 : matches = 96"
[1] "i = 8 : matches = 56"
[1] "i = 9 : matches = 4"
[1] "i = 10 : matches = 0"
Running rCompare...
[1] "datacomp : i = 1 : matches = 100"
Running rCompare...
[1] "datacomp : i = 2 : matches = 100"
Running rCompare...
[1] "datacomp : i = 3 : matches = 100"
Running rCompare...
[1] "datacomp : i = 4 : matches = 100"
Running rCompare...
[1] "datacomp : i = 5 : matches = 100"
Running rCompare...
[1] "datacomp : i = 6 : matches = 100"
Running rCompare...
[1] "datacomp : i = 7 : matches = 96"
Running rCompare...
[1] "datacomp : i = 8 : matches = 56"
Running rCompare...
[1] "datacomp : i = 9 : matches = 4"
Running rCompare...
[1] "datacomp : i = 10 : matches = 0"
from datacomparer.
Also tried a multi column approach - I wondered if the lapply
calling round
may have let to oddities on replication of the roundDigits
argument.
So I made a 4 column dataframe
(and apologise for the awful code)
a <- runif(100)
b <- runif(100)
c <- runif(100)
d <- runif(100)
a2 <- a + runif(100)*1E-8
b2 <- b + runif(100)*1E-8
c2 <- c + runif(100)*1E-8
d2 <- d + runif(100)*1E-8
df1 <- data.frame(a,b,c,d)
df2 <- data.frame(a2,b2,c2,d2)
names(df2) <- names(df1)
for(i in 1:15) {
rcmp <- rCompare(df1, df2, roundDigits = i)
mtchsa <- if(is.null(nrow(rcmp$mismatches$A))) {
100
} else {
100 - nrow(rcmp$mismatches$A)
}
mtchsb <- if(is.null(nrow(rcmp$mismatches$B))) {
100
} else {
100 - nrow(rcmp$mismatches$B)
}
mtchsc <- if(is.null(nrow(rcmp$mismatches$C))) {
100
} else {
100 - nrow(rcmp$mismatches$C)
}
mtchsd <- if(is.null(nrow(rcmp$mismatches$D))) {
100
} else {
100 - nrow(rcmp$mismatches$D)
}
print(paste0("datacomp : i = ", i, " : matches = ", mtchsa, " , ", mtchsb, " , ", mtchsc , " , ", mtchsd))
}
But this seems to work too
Running rCompare...
[1] "datacomp : i = 1 : matches = 100 , 100 , 100 , 100"
Running rCompare...
[1] "datacomp : i = 2 : matches = 100 , 100 , 100 , 100"
Running rCompare...
[1] "datacomp : i = 3 : matches = 100 , 100 , 100 , 100"
Running rCompare...
[1] "datacomp : i = 4 : matches = 100 , 100 , 100 , 100"
Running rCompare...
[1] "datacomp : i = 5 : matches = 100 , 100 , 100 , 100"
Running rCompare...
[1] "datacomp : i = 6 : matches = 100 , 100 , 100 , 100"
Running rCompare...
[1] "datacomp : i = 7 : matches = 94 , 93 , 96 , 96"
Running rCompare...
[1] "datacomp : i = 8 : matches = 49 , 51 , 54 , 47"
Running rCompare...
[1] "datacomp : i = 9 : matches = 2 , 6 , 8 , 4"
Running rCompare...
[1] "datacomp : i = 10 : matches = 0 , 0 , 2 , 1"
Running rCompare...
[1] "datacomp : i = 11 : matches = 0 , 0 , 0 , 0"
Running rCompare...
[1] "datacomp : i = 12 : matches = 0 , 0 , 0 , 0"
Running rCompare...
[1] "datacomp : i = 13 : matches = 0 , 0 , 0 , 0"
Running rCompare...
[1] "datacomp : i = 14 : matches = 0 , 0 , 0 , 0"
Running rCompare...
[1] "datacomp : i = 15 : matches = 0 , 0 , 0 , 0"
from datacomparer.
Have asked the user to provide a minimal broken example for further investigation.
from datacomparer.
The user hasn't come back with any further information - I will leave this open with the wontfix
label for now.
from datacomparer.
Change of heart with wontfix
- I want a tidy repo!
from datacomparer.
Related Issues (20)
- CVE-2020-11022 (Medium) detected in jquery-3.4.1.min.js
- CVE-2018-14040 (Medium) detected in bootstrap-3.3.5.min.js, bootstrap-3.3.5.js
- CVE-2018-20677 (Medium) detected in bootstrap-3.3.5.min.js, bootstrap-3.3.5.js
- CVE-2018-14042 (Medium) detected in bootstrap-3.3.5.min.js, bootstrap-3.3.5.js
- CVE-2018-20676 (Medium) detected in bootstrap-3.3.5.min.js, bootstrap-3.3.5.js
- CVE-2016-10735 (Medium) detected in bootstrap-3.3.5.min.js, bootstrap-3.3.5.js
- CVE-2015-9251 (Medium) detected in multiple libraries
- CVE-2019-11358 (Medium) detected in multiple libraries HOT 1
- Create Summary Percent Agreement HOT 1
- Make package available via conda HOT 4
- Fix devel checks HOT 1
- WS-2017-0234 (Medium) detected in jquery.dataTables-1.10.3.js - autoclosed HOT 1
- jquery-2.2.4.js: 4 vulnerabilities (highest severity is: 6.1) HOT 1
- jquery-2.2.4.min.js: 4 vulnerabilities (highest severity is: 6.1) HOT 1
- jquery-1.12.4.js: 4 vulnerabilities (highest severity is: 6.1)
- bootstrap-3.3.5.min.js: 6 vulnerabilities (highest severity is: 6.1)
- bootstrap-3.3.5.js: 6 vulnerabilities (highest severity is: 6.1)
- jquery-1.12.4.min.js: 4 vulnerabilities (highest severity is: 6.1)
- jquery.dataTables-1.10.3.js: 1 vulnerabilities (highest severity is: 6.5)
- `select_()` was deprecated in dplyr 0.7.0.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datacomparer.