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
| # create some random data | |
| set.seed(123) | |
| x <- rpois(100, lambda = 100) | |
| # approach 1: hard to compare due to different aspect ratios | |
| hist(x, breaks = c((min(x) - 1):(1 + max(x)))) | |
| plot(table(x), main = "Barplot of x") | |
| # approach 2: easier to compare | |
| library(dplyr) |
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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| // samples the height of one structure for a given maximum height (H) | |
| int sample_height(int maxHeight) { | |
| int height = 0; | |
| while (rand() % 2 == 1 & height < maxHeight) { | |
| height++; | |
| } | |
| return height; |
NewerOlder