Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removing duplicate files between repositories

  • Loading branch information...
commit 576bf9c5548a2ad2d9b683becb032caa179b37dc 1 parent 0441d25
Jenn authored
View
115 hyades/historicoscriptnuevo.txt
@@ -1,115 +0,0 @@
-require(graphics)
-x <- rbind(matrix(rnorm(100, sd = 0.3), ncol = 2),
- matrix(rnorm(100, mean = 1, sd = 0.3), ncol = 2))
-x
-colnames(x) <- c("x", "y")
-x
-(cl <- kmeans(x, 2))
-(cl <- kmeans(x, 3))
-plot(x, col = cl$cluster)
-points(cl$centers, col = 1:2, pch = 8, cex=2)
-fitted.x <- fitted(cl); head(fitted.x)
-resid.x <- x - fitted(cl)
-cbind(cl[c("betweenss", "tot.withinss", "totss")], # the same two columns
- c(ss(fitted.x), ss(resid.x), ss(x)))
-ss <- function(x) sum(scale(x, scale = FALSE)^2)
-plot(x, col = cl$cluster)
-points(cl$centers, col = 1:2, pch = 8, cex=2)
-fitted.x <- fitted(cl); head(fitted.x)
-resid.x <- x - fitted(cl)
-cbind(cl[c("betweenss", "tot.withinss", "totss")], # the same two columns
- c(ss(fitted.x), ss(resid.x), ss(x)))
-stopifnot(all.equal(cl$ totss, ss(x)),
- all.equal(cl$ tot.withinss, ss(resid.x)),
- ## these three are the same:
- all.equal(cl$ betweenss, ss(fitted.x)),
- all.equal(cl$ betweenss, cl$totss - cl$tot.withinss),
- ## and hence also
- all.equal(ss(x), ss(fitted.x) + ss(resid.x))
- )
-(cl <- kmeans(x, 5, nstart = 25))
-plot(x, col = cl$cluster)
-points(cl$centers, col = 1:5, pch = 8)
-setwd('C:/somethingnull/git/tools/hyades/')
-simbadO = read.table('simbad.csv', header=T, sep=';')
-hipparcosO = read.table('HIPPARCOS.csv', header=T, sep=';')
-#cut columns
-a = matrix(c(RA_J2000 = simbadO$RA_J2000, DE_J2000=simbadO$DE_J2000))
-b = matrix(c(RA_J2000=hipparcosO$RA_J2000, DE_J2000=hipparcosO$DE_J2000))
-rownames(a) <- simbadO$identifier
-rownames(b) <- hipparcosO$HIP
-# C�lculo de las distancias m�nimas
-min.dist <- array()
-min.dist.name <- array()
-a = matrix(c(RA_J2000 = simbadO$RA_J2000, DE_J2000=simbadO$DE_J2000))
-nrow(simbadO$identifier)
-length(simbadO$identifier)
-rownames(a) <-c(simbadO$identifier)
-dimnames()
-dimnames(a)
-a = matrix(c(RA_J2000 = simbadO$RA_J2000, DE_J2000=simbadO$DE_J2000), nrow=nrow(simbadO), byrow=T)
-head(a)
-rownames(a) <-c(simbadO$identifier)
-b = matrix(c(RA_J2000=hipparcosO$RA_J2000, DE_J2000=hipparcosO$DE_J2000), nrow=nrow(hipparcosO), byrow=T)
-head(b)
-rownames(b) <- hipparcosO$HIP
-head(a)
-head(b)
-# C�lculo de las distancias m�nimas
-min.dist <- array()
-min.dist.name <- array()
-for (i in 1:nrow(a)){
- for (j in 1:nrow(b)) {
- dists.ab[j] <- rbind(rbind(a[i,],b[j,])) #almaceno las distancias
- }
-min.dist.name[i] <- which.min(dists.ab)
-min.dist[i] <- min(dists.ab)
-}
-min.dist <- array()
-min.dist.name <- array()
-dists.ab <- array()
-for (i in 1:nrow(a)){
- for (j in 1:nrow(b)) {
- dists.ab[j] <- rbind(rbind(a[i,],b[j,])) #almaceno las distancias
- }
-min.dist.name[i] <- which.min(dists.ab)
-min.dist[i] <- min(dists.ab)
-}
-warnings()
-for (i in 1:nrow(a)){
- for (j in 1:nrow(b)) {
- dists.ab[j] <- dist(rbind(a[i,],b[j,])) #almaceno las distancias
- }
-min.dist.name[i] <- which.min(dists.ab)
-min.dist[i] <- min(dists.ab)
-}
-nrow(dists.ab)
-length(dists.ab)
-length(min.dist)
-head(min.dist)
-#getting the limit
-cruzados = read.table('id_cruzados.csv', header=T, sep=',')
-mcruzados = as.matrix(cruzados)
-for (i in 1:nrow(mcruzados)) {
- #create a mini matrix with one row.
- mnewmini = rbind(mcruzados[i,3:4], mcruzados[i,5:6])
- #matriz distance
- disti = dist(mnewmini)
- ##adding distance to dataframe.
- #format sci
- cruzados$distancia[i] = format(disti , sci = FALSE)
- #printdataframe
- cruzados$distancia[i]
-}
-maxjoindist = max(cruzados$distancia)
-head(min.dist)
-(min.dist
-)
-names(x=min.dist)
-names(min.dist)
-head(min.dist)
-is(min.dist)
-is(min.dist.name)
-head(min.dist.name)
-sink(file='Scriptnuevo.txt')
-save.image('scriptnuevo2.txt')
View
13,844 hyades/tychowithouthipparcosandcolumnhyades.csv
0 additions, 13,844 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.