distance

R cluster with Tanimoto/Jaccard

不羁的心 提交于 2019-12-30 05:35:06
问题 Input file is Mydata <- read.table(con <- textConnection(' gene treatment1 treatment2 treatment3 aaa 1 0 1 bbb 1 1 1 ccc 0 0 0 eee 0 1 0 '), header=TRUE) close(con) Mydata is gene treatment1 treatment2 treatment3 1 aaa 1 0 1 2 bbb 1 1 1 3 ccc 0 0 0 4 eee 0 1 0 In order to built cluster, I have done d <- dist(mydata, method = "euclidean") fit <- hclust(d, method="ward") plot(fit) I got the cluster based on "euclidean" distance. In my previous message in stackoverflow How to use R to compute

Calculating distance and velocity between time ordered coordinates

∥☆過路亽.° 提交于 2019-12-30 03:36:11
问题 I have a csv containing locations ( latitude , longitude ) for a given user denoted by the id field, at a given time ( timestamp ). I need to calculate the distance and the velocity between a point and the successive point for each user. For example, for ID 1 I need to find the distance and velocity between point 1 and point 2, point 2 and point 3, point 3 and point 4, and so on. Given I am working with coordinates on the Earth, I understand the Haversine metric will be used for distance

Visualizing distance between nodes according to weights - with R

穿精又带淫゛_ 提交于 2019-12-29 06:59:47
问题 I'm trying to draw a graph where the distance between vertices correspond to the edge weights* and I've founde that in graphviz there is a way to draw such graph. Is there a way to do this in R with the igraph package (specfically with graph.adkacency)? Thanks, Noam (as once have been asked: draw a graph where the distance between vertices correspond to the edge weights) 回答1: This is not possible as you need triangle equality for every triangle to be able to plot such an object. So you can

How to calculate the current speed and average speed of user travelling from current location to particular locaction in iPhone? [closed]

那年仲夏 提交于 2019-12-29 04:50:26
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I am having a map application. When a person travels from current location to particular location I want to calculate the distance covered by the person, the current speed of the person, average speed of the

Mahalanobis distance in R

烂漫一生 提交于 2019-12-29 03:32:48
问题 I have found the mahalanobis.dist function in package StatMatch (http://cran.r-project.org/web/packages/StatMatch/StatMatch.pdf) but it isn't doing exactly what I want. It seems to be calculating the mahalanobis distance from each observation in data.y to each observation in data.x I would like to calculate the mahalanobis distance of one observation in data.y to all observations in data.x. Basically calculate a mahalanobis distance of one point to a "cloud" of points if that makes sense.

Get polygons close to a lat,long in MySQL

随声附和 提交于 2019-12-28 04:04:16
问题 Does anyone know of a way to fetch all polygons in a MySQL db within a given distance from a point? The actual distance is not that important since it's calculated for each found polygon later, but it would be a huge optimization to just do that calculation for the polygons that are "close". I've looked at the MBR and contains functions but the problem is that some of the polygons are not contained within a bounding box drawn around the point since they are very big, but some of their

Measure distance between two HTML elements' centers

戏子无情 提交于 2019-12-28 02:47:56
问题 If I have HTML elements as follows: <div id="x"></div> <div id="y" style="margin-left:100px;"></div> ...how do I find the distance between them in pixels using JavaScript? 回答1: Get their positions, and use the Pythagorean Theorem to determine the distance between them... function getPositionAtCenter(element) { const {top, left, width, height} = element.getBoundingClientRect(); return { x: left + width / 2, y: top + height / 2 }; } function getDistanceBetweenElements(a, b) { const aPosition =

Find input image (ID,passport) in imagesDB based on similarity

帅比萌擦擦* 提交于 2019-12-25 18:53:49
问题 I would like to decide if an image is present in a list stored in a DB (e.g. pictures of IDs, passport, Stu. card, etc). I thought about using a KNN algorithm, that will plot the K closest images. Options for distance metric: sum of Euclidean distance between each relative pixels (img1[pixel_i], img2[pixel_i]) sum of Euclidean distance betwen each pixel to each other, multiplied by some factor decreasing with distance (pixel to pixel) same as above, but with manhattan... Do you know/think of

WI-FI 802.11 speed depending on distance

大憨熊 提交于 2019-12-25 16:46:19
问题 can someone help me with a document containing the theoretical exact speed of different standards of 802.11 WI-FI depending on the distance (1 to 10 meters) ? like if there is an mathematical equation that gives how the speed decrease with distance ,or software tool, or a table that gives how speed decreases every 1 meter for example , i need something very exact. THank you :) 回答1: Pure distance effect while dismissing accompanying factors is negligeble due to the following facts: Assuming

How to find the nearest distance between two different data frames

人盡茶涼 提交于 2019-12-25 11:03:04
问题 I am trying to find the nearest distance of locations in dataset 1 to dataset 2. Both data sets are different sizes. Ive looked into using the Haversine function but I'm unsure what I need to do after. 回答1: Since you have not provided a sample of your data, I am going to use the oregon.tract data set from the UScensus2000tract library as a reproducible example. Here is a solution based on fast data.table that I get from this other answer here. # load libraries library(data.table) library