Question: I am having trouble extract best match from string-distance matrix.

I am using the package stringdist to compute string-distance matrix.

For example, i am generating my matrix using these lines of code.

```
library(stringdist)
lookup <- c('Dog', 'Cat', 'Bear')
data <- c('Do g', 'Do gg', 'Caat')
d.matrix <- stringdistmatrix(a = lookup, b = data, useNames="strings",method="cosine")

```

The matrix looks something like this 

[![enter image description here](https://i.stack.imgur.com/lS5QO.png)](https://i.stack.imgur.com/lS5QO.png)

My approach is to extract the cosine similarity with lowest number being the best match.

For example, "Do g" would match with "Dog"

What i want to generate is a matching pair data-frame with consine similarity value

```
data  |  matchwith  |  cosine.s

Do g       Dog         0.1338746
Do gg      Dog         0.1271284
Caat       Cat         0.05719096

```

I have no clue how to get the data to the table format that i want (above). 

Any help would be much appreciated.

Answer: 
Try using `[value]` instead of `value`

```
<ion-list radio-group *ngFor="let category of categories">
    <div *ngIf="category.id === '1'">
      <ion-item>
        <ion-label>{{ category.category_title }}</ion-label>
        <ion-radio [checked]="true" [value]="category.id" (ionSelect)="selectedCategory(category.id)"></ion-radio>
      </ion-item>
    </div>

    <div *ngIf="category.id !== '1'">
      <ion-item>
        <ion-label>{{ category.category_title }}</ion-label>
        <ion-radio [checked]="false" [value]="category.id" (ionSelect)="selectedCategory(category.id)"></ion-radio>
      </ion-item>
    </div>
</ion-list>

```
I guess your **`category.id`** is a string, so you should enclose within **`''`**

```
<div *ngIf="category.id === '1'">

```