This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> table(mtcars$cyl, mtcars$carb, mtcars$gear) | |
, , = 3 | |
1 2 3 4 6 8 | |
4 1 0 0 0 0 0 | |
6 2 0 0 0 0 0 | |
8 0 4 3 5 0 0 | |
, , = 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> CramerV(mtcars$gear, mtcars$cyl) | |
[1] 0.5308655 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> CramerV(mtcars$gear, mtcars$cyl, correct = TRUE) | |
[1] 0.4819631 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> TschuprowT(mtcars$gear, mtcars$cyl, correct = TRUE) | |
[1] 0.4819631 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> TschuprowT(mtcars$gear, mtcars$cyl) | |
[1] 0.5308655 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> jobhappiness<-matrix(c(5,7,13,10), ncol = 2) | |
> rownames(jobhappiness)<-c("Developers", "Mathematicians") | |
> colnames(jobhappiness)<-c("Happy", "Unhappy") | |
> phi(jobhappiness) | |
[1] -0.14 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { from } from "rxjs"; | |
import { filter, reduce } from "rxjs/operators"; | |
const number$ = from([null, 2, 1, undefined, 5, false, 6, 7]); | |
// Adding numbers | |
number$ | |
.pipe( | |
filter<number>(Boolean), | |
reduce((acc, curr) => acc + curr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { from } from "rxjs"; | |
import { filter, reduce } from "rxjs/operators"; | |
const number$ = from([null, 2, 1, 0, 5, false, 6, 7]).pipe( | |
filter<number>(Boolean) | |
); | |
// Adding numbers | |
number$ | |
.pipe( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DataService { | |
pokemonLevel$ = new BehaviorSubject<number>(1); | |
stop$: Subject<void> = new Subject(); | |
number$ = interval(1000).pipe(takeUntil(this.stop$)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DataService { | |
private pokemonLevel = new BehaviorSubject<number>(1); | |
private stop$: Subject<void> = new Subject(); | |
pokemonLevel$ = this.pokemonLevel.asObservable(); | |
increaseLevel(level: number) { | |
if (!this.isValidLevel(level)) { | |
throw new Error("Level is not valid"); | |
} |