Your SlideShare is downloading. ×
  • Like
Rの紹介
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Rの紹介

  • 640 views
Published

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
640
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Aの音が221Hz, 442Hz, 884Hz\n1オクターブ毎に2のN乗倍になっている\n
  • Aの音が221Hz, 442Hz, 884Hz\n1オクターブ毎に2のN乗倍になっている\n
  • \n
  • \n
  • \n
  • \n

Transcript

  • 1. > x <- iris[, 1:4]> dim(x)[1] 150 4> cl <- kmeans(x, 3, nstart=10)> print(cl)K-means clustering with 3 clusters of sizes 50, 38, 62Cluster means: Sepal.Length Sepal.Width Petal.Length Petal.Width1 5.006000 3.428000 1.462000 0.2460002 6.850000 3.073684 5.742105 2.0710533 5.901613 2.748387 4.393548 1.433871Clustering vector: [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [40] 1 1 1 1 1 1 1 1 1 1 1 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 [79] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 2 2 2 2 3 2 2 2 2 2 2 3 3 2 2[118] 2 2 3 2 3 2 3 2 2 3 3 2 2 2 2 2 3 2 2 2 2 3 2 2 2 3 2 2 2 3 2 2 3Within cluster sum of squares by cluster:[1] 15.15100 23.87947 39.82097 (between_SS / total_SS = 88.4 %)Available components:[1] "cluster" "centers" "totss" "withinss" "tot.withinss"[6] "betweenss" "size"
  • 2. > plot(x, col=cl$cluster)
  • 3. > for (i in 0:26) { > install.packages(“tuneR”)+ print (round(2^(i/12.0)*221.0)) > library(tuneR)+ } > scale <- bind(sine(263, bit=16), # C[1] 221 # A sine(295, bit=16), # D[1] 234 # Bb sine(313, bit=16), # E[1] 248 # B sine(351, bit=16), # F[1] 263 # C sine(394, bit=16), # G[1] 278 # Db sine(442, bit=16), # A[1] 295 # D sine(496, bit=16)) # B[1] 313 # Eb > writeWave(scale, "C_Major_Scale.wav")[1] 331 # E > scale <- bind(sine(263, bit=16), # C[1] 351 # F sine(295, bit=16), # D[1] 372 # Gb sine(313, bit=16), # Eb[1] 394 # G sine(351, bit=16), # F[1] 417 # Ab sine(394, bit=16), # G[1] 442 # A sine(417, bit=16), # Ab[1] 468 # Bb sine(468, bit=16)) # Bb[1] 496 # B > writeWave(scale, "C_Natural_Minor_Scale.wav")[1] 526 # C[1] 557 # Db[1] 590 # D[1] 625 # Eb[1] 662 # E[1] 702 # F[1] 743 # Gb[1] 788 # G[1] 834 # Ab[1] 884 # A[1] 937 # Bb[1] 1051 # B
  • 4. > for (i in 0:26) { > install.packages(“tuneR”)+ print (round(2^(i/12.0)*221.0)) > library(tuneR)+ } > scale <- bind(sine(263, bit=16), # C[1] 221 # A sine(295, bit=16), # D[1] 234 # Bb sine(313, bit=16), # E[1] 248 # B sine(351, bit=16), # F[1] 263 # C sine(394, bit=16), # G[1] 278 # Db sine(442, bit=16), # A[1] 295 # D sine(496, bit=16)) # B[1] 313 # Eb > writeWave(scale, "C_Major_Scale.wav")[1] 331 # E > scale <- bind(sine(263, bit=16), # C[1] 351 # F sine(295, bit=16), # D[1] 372 # Gb sine(313, bit=16), # Eb[1] 394 # G sine(351, bit=16), # F[1] 417 # Ab sine(394, bit=16), # G[1] 442 # A sine(417, bit=16), # Ab[1] 468 # Bb sine(468, bit=16)) # Bb[1] 496 # B > writeWave(scale, "C_Natural_Minor_Scale.wav")[1] 526 # C[1] 557 # Db[1] 590 # D[1] 625 # Eb[1] 662 # E[1] 702 # F[1] 743 # Gb[1] 788 # G[1] 834 # Ab[1] 884 # A[1] 937 # Bb[1] 1051 # B
  • 5. > for (i in 0:26) { > install.packages(“tuneR”)+ print (round(2^(i/12.0)*221.0)) > library(tuneR)+ } > scale <- bind(sine(263, bit=16), # C[1] 221 # A sine(295, bit=16), # D[1] 234 # Bb sine(313, bit=16), # E[1] 248 # B sine(351, bit=16), # F[1] 263 # C sine(394, bit=16), # G[1] 278 # Db sine(442, bit=16), # A[1] 295 # D sine(496, bit=16)) # B[1] 313 # Eb > writeWave(scale, "C_Major_Scale.wav")[1] 331 # E > scale <- bind(sine(263, bit=16), # C[1] 351 # F sine(295, bit=16), # D[1] 372 # Gb sine(313, bit=16), # Eb[1] 394 # G sine(351, bit=16), # F[1] 417 # Ab sine(394, bit=16), # G[1] 442 # A sine(417, bit=16), # Ab[1] 468 # Bb sine(468, bit=16)) # Bb[1] 496 # B > writeWave(scale, "C_Natural_Minor_Scale.wav")[1] 526 # C[1] 557 # Db[1] 590 # D[1] 625 # Eb[1] 662 # E[1] 702 # F[1] 743 # Gb[1] 788 # G[1] 834 # Ab[1] 884 # A[1] 937 # Bb[1] 1051 # B
  • 6. Japan.— R —