Description Usage Arguments Value Examples
Calculate the fractal dimension of a dataset by using the Sand-Box method
1 |
data |
Data of class: |
rad |
Vector containning values of the radial. |
A list containing
Fdim
Computed fractal dimension.
SB
Data frame of log (radial) and the log (number of points).
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ## Not run:
data <- unidat(n=10000, d=20)
data<-apply(data,MARGIN=2,FUN = function(X) (X - min(X))/diff(range(X)))
rad<-seq(0.7,0.9,0.01)
A<-GlobalSB(data, rad)
A$Fdim
plot(A[[2]][,1],A[[2]][,2],type="b",pch=16,lwd=2,xlab="log(Rad)",ylab="log(N)",
main="Sandbox plot", cex.main=1.5, las=1, axes=F)
axis(1)
axis(2)
grid()
Regline <- lm(A[[2]][,2]~A[[2]][,1])
abline(Regline, col="red", lwd=2)
legend("bottomright",paste("Fractal dimension:", round(A$Fdim,2)), bty="n")
#### IDmining examples #####
library(IDmining)
#### SwissRoll dataset ####
data<-SwissRoll(N=1000)
data<-apply(data,MARGIN=2,FUN = function(X) (X - min(X))/diff(range(X)))
rad<-seq(0.1,0.31,0.01)
A<-GlobalSB(data, rad)
A$Fdim
plot(A[[2]][,1],A[[2]][,2],type="b",pch=16,lwd=2,xlab="log(Rad)",ylab="log(N)",
main="Sandbox plot", cex.main=1.5, las=1, axes=F)
axis(1)
axis(2)
grid()
Regline <- lm(A[[2]][,2]~A[[2]][,1])
abline(Regline, col="red", lwd=2)
legend("bottomright",paste("Fractal dimension:", round(A$Fdim,2)), bty="n")
#### Butterfly dataset ####
data <- Butterfly(1000)[,-9]
data<-apply(data,MARGIN=2,FUN = function(X) (X - min(X))/diff(range(X)))
rad<-seq(0.1,0.31,0.01)
A<-GlobalSB(data, rad)
A$Fdim
plot(A[[2]][,1],A[[2]][,2],type="b",pch=16,lwd=2,xlab="log(Rad)",ylab="log(N)",
main="Sandbox plot", cex.main=1.5, las=1, axes=F)
axis(1)
axis(2)
grid()
Regline <- lm(A[[2]][,2]~A[[2]][,1])
abline(Regline, col="red", lwd=2)
legend("bottomright",paste("Fractal dimension:",
round(Regline$coefficient[2],2)), bty="n")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.