Skip to content

Instantly share code, notes, and snippets.

---
title: "R Notebook"
output: html_notebook
---
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ctrl+Shift+Enter*.
```{r}
import { Component, State, h } from '@stencil/core';
import { Holdings } from "../../services/holdings";
// interfaceで連想配列Holdingの中身の型の定義を行う
// value? は値が存在しなくてもよいという意味?
interface Holding {
crypto: string;
currency: string;
amount: number;
value?: number;
import { Component, h } from "@stencil/core";
import { Holdings } from "../../services/holdings";
@Component({
tag: "app-add-holding",
styleUrl: "app-add-holding.css"
})
export class AppAddHolding {
private holdingsService: Holdings = new Holdings();
private cryptoCode: string;
// Animalクラスの定義
class Animal {
// コンストラクタの定義
constructor(name) {
this.name = name;
}
// speakメソッドの定義
speak() {
console.log(this.name + "「鳴き声」");
}
import { Component, State, Prop, h } from "@stencil/core";
import { Todo } from "../../interfaces/todo";
import { TodosService } from "../../services/todos";
@Component({
tag: "app-detail",
styleUrl: "app-detail.css"
})
export class AppDetail {
public navCtrl = document.querySelector("ion-router");
import { set, get } from "./storage";
import { Todo } from "../interfaces/todo";
class todosServiceController {
public todos: Todo[];
async load(): Promise<Todo[]> {
if (this.todos) {
return this.todos;
} else {
import { Component, State, Listen } from '@stencil/core';
@Component({
tag: 'app-home',
styleUrl: 'app-home.css'
})
export class AppHome {
@State() todos: any;
@State() newTodo;
<template>
<div class="about">
<h1>現在地</h1>
<p>緯度:{{latitude}}</p>
<p>経度:{{longitude}}</p>
<h2>1分前</h2>
<p>緯度:{{lat2}}</p>
<p>経度:{{lng1}}</p>
<template>
<div class="about">
<h1>現在地</h1>
<p>緯度:{{latitude}}</p>
<p>経度:{{longitude}}</p>
<h2>歩いた距離</h2>
<p>1分間で歩いた距離:{{d}} km</p>
<p>合計:{{length}} km</p>
</div>
<template>
<div id="mapid"></div>
</template>
<script>
import "leaflet/dist/leaflet.css";
import L from "leaflet";
delete L.Icon.Default.prototype._getIconUrl;
L.Icon.Default.mergeOptions({