12th Marks Calculator
By Muzammil Farook
Developed by
@Muzammil_Farook
Please be informed that this is not the offical marks.This is just an utility to help students and teachers.
Results
Your percentage is
%
Total score is
Your engineering cut off is
Calculate again
10th Marks
10th Best 1
10th Best 2
10th Best 3
11th Total (Enter 11th theory marks only)
Language (Out 0f 90)
English (Out 0f 90)
Physics (Out 0f 70)
Chemistry (Out 0f 70)
Maths (Out 0f 90)
Computer science/Biology (Out 0f 70)
12th Total (No need to enter this)
Submit


@* * Copyright 2021 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import cats.implicits._ @(key: List[String], values: String, errors: ErrorTree, messages: UniformMessages[Html], autoFields: Option[String] = None, inputClass: String = "form-control form-control-2-3") @headKey=@{key.headOption.getOrElse("")} @percentageInput=@{ headKey === "report-social-media-operating-margin" || headKey === "report-search-engine-operating-margin" || headKey === "report-online-marketplace-operating-margin" } @currencyInput=@{ headKey === "relief-deducted"|| headKey === "allowance-deducted"|| headKey === "group-liability"|| headKey.contains("company-liabilities") } @telInput=@{key.contains("phoneNumber")} @autoComplete=@{key match { case k if k.contains("forename") => "given-name" case k if k.contains("surname") => "family-name" case k if k.contains("phoneNumber") => "tel" case k if k.contains("line1") => "address-line1" case k if k.contains("line2") => "address-line2" case k if k.contains("line3") => "address-line3" case k if k.contains("line4") => "address-level4" case k if k.contains("postcode") | k.contains("company-registered-office-postcode") => "postal-code" case k if k.contains("country") => "country-name" case k if k.contains("email") => "email" case _ => "" }}


Index - manages mapping of (k,w)-kmer-representation and all its occurences.
More...
#include <index.hpp>
|
|
virtual | ~Index ()=default |
| | Virtual destructor for Index.
|
| |
| virtual const std::vector< position_in_read_t > & | positions_in_reads () const =0 |
| | returns an array of starting positions of sketch elements in their reads More...
|
| |
| virtual const std::vector< read_id_t > & | read_ids () const =0 |
| | returns an array of reads ids for sketch elements More...
|
| |
| virtual const std::vector< SketchElement::DirectionOfRepresentation > & | directions_of_reads () const =0 |
| | returns an array of directions in which sketch elements were read More...
|
| |
| virtual std::uint64_t | number_of_reads () const =0 |
| | returns number of reads in input data More...
|
| |
| virtual const std::vector< std::string > & | read_id_to_read_name () const =0 |
| | returns mapping of internal read id that goes from 0 to number_of_reads-1 to actual read name from the input More...
|
| |
| virtual const std::vector< std::uint32_t > & | read_id_to_read_length () const =0 |
| | returns mapping of internal read id that goes from 0 to read lengths for that read More...
|
| |
| virtual std::uint64_t | minimum_representation () const =0 |
| | minimum possible representation More...
|
| |
| virtual std::uint64_t | maximum_representation () const =0 |
| | maximum possible representation More...
|
| |
| virtual const std::vector< std::vector< RepresentationToSketchElements > > & | read_id_and_representation_to_sketch_elements () const =0 |
| | For each read_id (outer vector) returns a vector in which each element contains a representation from that read, pointer to section of data arrays with sketch elements with that representation and that read_id, and pointer to section of data arrays with skecth elements with that representation and all read_ids. There elements are sorted by representation in increasing order. More...
|
| |
| virtual bool | reached_end_of_input () const =0 |
| | Returns whether there are any more reads to process in the reads file (e.g FASTA file) More...
|
| |
|
| static std::unique_ptr< Index > | create_index (const std::vector< io::FastaParser * > &parsers, const std::uint64_t kmer_size, const std::uint64_t window_size, const std::vector< std::pair< std::uint64_t, std::uint64_t >> &ranges) |
| | generates a mapping of (k,w)-kmer-representation to all of its occurrences for one or more sequences More...
|
| |
| static std::unique_ptr< Index > | create_index () |
| | creates an empty Index More...
|
| |
| static uint64_t | maximum_kmer_size () |
| | Return the maximum kmer length allowable. This is just the size of the representation in bits divided by two (since 2 bits are required to represent a DNA nucleotide). More...
|
| |
Index - manages mapping of (k,w)-kmer-representation and all its occurences.
◆ create_index() [1/2]
| static std::unique_ptr<Index> claragenomics::cudamapper::Index::create_index |
( |
| ) |
|
|
static |
creates an empty Index
- Returns
- empty instacne of Index
◆ create_index() [2/2]
| static std::unique_ptr<Index> claragenomics::cudamapper::Index::create_index |
( |
const std::vector< io::FastaParser * > & |
parsers, |
|
|
const std::uint64_t |
kmer_size, |
|
|
const std::uint64_t |
window_size, |
|
|
const std::vector< std::pair< std::uint64_t, std::uint64_t >> & |
ranges |
|
) |
| |
|
static |
generates a mapping of (k,w)-kmer-representation to all of its occurrences for one or more sequences
- Parameters
-
| parsers | Vector of parsers for each element in ranges. Size of this vector must match size of ranges. |
| kmer_size | k - the kmer length |
| window_size | w - the length of the sliding window used to find sketch elements |
| ranges | - the ranges of reads in the query file to use for mapping, index by their position (e.g in the FASTA file) |
- Returns
- instance of Index
◆ directions_of_reads()
returns an array of directions in which sketch elements were read
- Returns
- an array of directions in which sketch elements were read
◆ maximum_kmer_size()
| static uint64_t claragenomics::cudamapper::Index::maximum_kmer_size |
( |
| ) |
|
|
inlinestatic |
Return the maximum kmer length allowable. This is just the size of the representation in bits divided by two (since 2 bits are required to represent a DNA nucleotide).
- Returns
- Return the maximum kmer length allowable
◆ maximum_representation()
| virtual std::uint64_t claragenomics::cudamapper::Index::maximum_representation |
( |
| ) |
const |
|
pure virtual |
maximum possible representation
- Returns
- the largest possible representation
◆ minimum_representation()
| virtual std::uint64_t claragenomics::cudamapper::Index::minimum_representation |
( |
| ) |
const |
|
pure virtual |
minimum possible representation
- Returns
- the smallest possible representation
◆ number_of_reads()
| virtual std::uint64_t claragenomics::cudamapper::Index::number_of_reads |
( |
| ) |
const |
|
pure virtual |
returns number of reads in input data
- Returns
- number of reads in input data
◆ positions_in_reads()
| virtual const std::vector<position_in_read_t>& claragenomics::cudamapper::Index::positions_in_reads |
( |
| ) |
const |
|
pure virtual |
returns an array of starting positions of sketch elements in their reads
- Returns
- an array of starting positions of sketch elements in their reads
◆ reached_end_of_input()
| virtual bool claragenomics::cudamapper::Index::reached_end_of_input |
( |
| ) |
const |
|
pure virtual |
Returns whether there are any more reads to process in the reads file (e.g FASTA file)
- Returns
- Returns whether there are any more reads to process in the reads file (e.g FASTA file)
◆ read_id_and_representation_to_sketch_elements()
| virtual const std::vector<std::vector<RepresentationToSketchElements> >& claragenomics::cudamapper::Index::read_id_and_representation_to_sketch_elements |
( |
| ) |
const |
|
pure virtual |
For each read_id (outer vector) returns a vector in which each element contains a representation from that read, pointer to section of data arrays with sketch elements with that representation and that read_id, and pointer to section of data arrays with skecth elements with that representation and all read_ids. There elements are sorted by representation in increasing order.
- Returns
- the mapping
◆ read_id_to_read_length()
| virtual const std::vector<std::uint32_t>& claragenomics::cudamapper::Index::read_id_to_read_length |
( |
| ) |
const |
|
pure virtual |
returns mapping of internal read id that goes from 0 to read lengths for that read
- Returns
- mapping of internal read id that goes from 0 to read lengths for that read
◆ read_id_to_read_name()
| virtual const std::vector<std::string>& claragenomics::cudamapper::Index::read_id_to_read_name |
( |
| ) |
const |
|
pure virtual |
returns mapping of internal read id that goes from 0 to number_of_reads-1 to actual read name from the input
- Returns
- mapping of internal read id that goes from 0 to number_of_reads-1 to actual read name from the input
◆ read_ids()
| virtual const std::vector<read_id_t>& claragenomics::cudamapper::Index::read_ids |
( |
| ) |
const |
|
pure virtual |
returns an array of reads ids for sketch elements
- Returns
- an array of reads ids for sketch elements
The documentation for this class was generated from the following file:
- cudamapper/include/claragenomics/cudamapper/index.hpp


--- layout: default title: Tour permalink: /tour/ ---
Welcome to Sterling! On this page, we give a brief introduction to the Sterling user interface. After taking this tour, you'll know how to navigate the views provided by Sterling and you'll be ready to explore some of the more in-depth features and settings on your own.
Sterling is a web-based visualizer for Alloy, providing enhanced graph and table views in an effort to make instances easier to explore and understand. It is built on top of Alloy <IP_ADDRESS>, making only two small additions to the Alloy interface in order to support connection to the browser. When Alloy Sterling is first launched, you are given a link that will open Sterling in your default browser. Additionally, a "Web" button that does the same has been added to the Alloy visualizer.
Alloy is unchanged aside from these two additions, and using Sterling to visualize instances is entirely opt-in.
To Alloy users, Sterling will likely feel very familiar. The interface draws inspiration from Alloy, and many of its features have been migrated to Sterling. Much like the built-in Alloy visualizer, Sterling displays only a single instance at a time.
You are provided with three views — Graph, Table, and Source — that are accessible from the navigation bar at the top of the window.
The Next button at the right side of the navigation bar can be used to generate and display the next solution.
The sidebar, on the left edge of the screen, contains buttons that will open a drawer which contains tools or options. The buttons above the divider are specific to the currently active view — Graph in the following image — and those below the divider are tools that are available regardless of the currently active view.
Let's take a look at what each view has to offer, starting with the Graph view.
The graph view displays the current instance as a directed graph, and provides a lot of the same functionality as the Viz tab in Alloy. For example, projections are fully supported and relations can be viewed as attributes. Additionally, graph nodes are draggable and the view can be panned and zoomed. The following video gives a brief tour of some of the basic functionality in the Graph view (hover over the video to show controls — full screen is available).
Compared to the Alloy visualizer, there are a few key differences in the graph view, all of which are demonstrated in the video above.
The sidebar buttons for the Graph view are as follows:
The Table view displays the signatures, fields, and skolems of the current instance as a set of tables. Advanced sorting and filtering options make it easy to explore the instance and find the specific data you're looking for. Furthermore, Sterling introduces the ability to highlight skolemized variables, as shown in the video below.
The script view provides an environment for the development of custom visualizations by bringing together a text editor, and blank canvas, and a JavaScript execution environment. This gives you a basic "code sandbox" in which you can create visualizations based on instance data using your favorite JS libraries.
Within the script view environment, all instance data (the signatures, fields, atoms, and tuples) are exposed as JS variables. Furthermore, you have direct access to the npm package repository, which can be used to add visualization libraries to the scripting environment.
Each time an instance is generated by Alloy, Sterling automatically executes the script to re-render the custom visualization. This automatic execution continues even as you return to Alloy and modify the model. If the model is changed in a way that causes the visualization script to throw an error, you'll be notified of the error, and the visualization script will not be automatically executed until it has been updated and successfully rerun.
The source view simply provides you with all of the Alloy source files used to generate the currently displayed instance. They are not editable files, and simply serve as a convenient way to refer back to the models.
The evaluator is a drawer tool that is accessible from any view by clicking on the terminal icon in the sidebar. It provides the same evaluator functionality that you are used to in Alloy and allows you to toggle between textual and tabular views of the results.


Enter two texts below. The replacement text will have its words replaced by words beginning with the same letter in the source text.
Source text
Text for replacement


class: center, top, title-slide # STAT 155: Lecture Slides 2 ## Data Visualization and Manipulation ### Bryan Martin --- # Outline 1. Introduction to tidyverse 2. Data Visualization 3. Data Manipulation .middler[**Goal:** Learn how to go from raw data to exploratory data analysis. (Project 1!)] --- class: inverse .sectionhead[Part 1: Introduction to tidyverse] --- layout: true # tidyverse --- The `tidyverse` is a collection of powerful R packages for data science. They include: * Reading and saving data: `readr` * Data manipulation: `tidyr`, `dplyr` * Data visualization: `ggplot2` * Working with different data structures: `tibble`, `purrr`, `stringr`, `forcats` You can install them all using ```r install.packages("tidyverse") ``` (Remember, you only need to do this once!) --- Load them all together in your workflow documents by calling ```r library(tidyverse) ``` ``` ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ── ``` ``` ## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4 ## ✓ tibble 3.1.3 ✓ dplyr 1.0.7 ## ✓ tidyr 1.1.3 ✓ stringr 1.4.0 ## ✓ readr 2.0.1 ✓ forcats 0.5.1 ``` ``` ## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ── ## x dplyr::filter() masks stats::filter() ## x dplyr::group_rows() masks kableExtra::group_rows() ## x dplyr::lag() masks stats::lag() ``` --- ## Conflicts? Recall that packages are essentially ways for you to install and use functions written by others. Occasionally, some of these functions have the same name and there is a conflict. Whichever package you load more recently using `library` will mask the old function, meaning that R will default to that version. In general, this is fine, especially with `tidyverse`. These package authors know when they have masked common functions in R, and typically we will prefer `tidyverse` version. The conflict message is to make sure you know about conflicts. You can (and should) hide this in your R Markdown files by adding the parameter `message=FALSE` or `include=FALSE` to your code chunk when you load packages. --- layout: false layout: true # Pipes --- .sectionhead[![pipe](pipe.png)] --- **pipes** use the `%>%` operator to take the output from a previous function call and "pipe" it through to the next function. This can really help with readability of code when we use multiple nested functions! We will use the `gapminder` data from Jenny Bryan to demonstrate throughout this section. Load the package `gapminder` (after installing) and the corresponding data. ```r library(gapminder) data(gapminder) ``` Let's preview the data. ```r gapminder ``` ``` ## # A tibble: 1,704 × 6 ## country continent year lifeExp pop gdpPercap ## <fct> <fct> <int> <dbl> <int> <dbl> ## 1 Afghanistan Asia 1952 28.8 8425333 779. ## 2 Afghanistan Asia 1957 30.3 9240934 821. ## 3 Afghanistan Asia 1962 32.0 10267083 853. ## 4 Afghanistan Asia 1967 34.0 11537966 836. ## 5 Afghanistan Asia 1972 36.1 13079460 740. ## 6 Afghanistan Asia 1977 38.4 14880372 786. ## 7 Afghanistan Asia 1982 39.9 12881816 978. ## 8 Afghanistan Asia 1987 40.8 13867957 852. ## 9 Afghanistan Asia 1992 41.7 16317921 649. ## 10 Afghanistan Asia 1997 41.8 22227415 635. ## # … with 1,694 more rows ``` --- ## A brief note on factors ```r str(gapminder) ``` ``` ## tibble [1,704 × 6] (S3: tbl_df/tbl/data.frame) ## $ country : Factor w/ 142 levels "Afghanistan",..: 1 1 1 1 1 1 1 1 1 1 ... ## $ continent: Factor w/ 5 levels "Africa","Americas",..: 3 3 3 3 3 3 3 3 3 3 ... ## $ year : int [1:1704] 1952 1957 1962 1967 1972 1977 1982 1987 1992 1997 ... ## $ lifeExp : num [1:1704] 28.8 30.3 32 34 36.1 ... ## $ pop : int [1:1704] 8425333 9240934 10267083 11537966 13079460 14880372 12881816 13867957 16317921 22227415 ... ## $ gdpPercap: num [1:1704] 779 821 853 836 740 ... ``` **factors** are categorical data that use integer representation. This can be efficient to store character vectors, because each string is only entered once. Because of this, creating data frames (but not tibbles!) in R often default to set strings as factors. However, it can also get annoying! Factors limit the categories, or `levels`, of the vector, which is often not appropriate. I usually turn this off by setting the parameter `stringsAsFactors = FALSE` when I use `data.frame()`, unless I specifically want my data encoded as categorical. --- ## Functions in Functions What if we want the mean log population within our data set? Using base R, we might type ```r mean(log(gapminder$pop)) ``` ``` ## [1] 15.76611 ``` With pipes, we can use ```r gapminder$pop %>% log() %>% mean() ``` ``` ## [1] 15.76611 ``` Both of these are acceptable. However, when we start adding more and more functions, pipes can make your code much easier and more natural to read. --- layout: false # filtering data Very commonly, we will want to filter our data to restrict what we plot or analyze. For example, what if we are only interested in data from China since 1970? ```r china_1980 <- gapminder %>% filter(country == "China" & year >= 1970) china_1980 ``` ``` ## # A tibble: 8 × 6 ## country continent year lifeExp pop gdpPercap ## <fct> <fct> <int> <dbl> <int> <dbl> ## 1 China Asia 1972 63.1 862030000 677. ## 2 China Asia 1977 64.0 943455000 741. ## 3 China Asia 1982 65.5<PHONE_NUMBER> 962. ## 4 China Asia 1987 67.3<PHONE_NUMBER> 1379. ## 5 China Asia 1992 68.7<PHONE_NUMBER> 1656. ## 6 China Asia 1997 70.4<PHONE_NUMBER> 2289. ## 7 China Asia 2002 72.0<PHONE_NUMBER> 3119. ## 8 China Asia 2007 73.0<PHONE_NUMBER> 4959. ``` --- class: inverse .sectionhead[Part 2: Data Visualization] --- layout: true # Data Visualization --- `ggplot2` is a fantastic way to make complex publication quality1 images without much pre-processing of your data. Plots are built sequentially using layers, so it's easy to edit and fine-tune the plots you generate. When using `ggplot2`, it is *essential* that your data are tidy! If they are not, the functions probably will not look like you expect. Let's work through how to build a plot layer by layer. .footnote[[1] or STAT155 Project quality] --- First, let's initialize a plot. Use the `data` parameter to tell `ggplot` what data frame to use. * It should be tidy data, in either a `data.frame` or `tibble`! .pull-left[ ```r *ggplot(data = gapminder) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-10-1.png) ] --- Add an aesthetic using the function `aes()` within the initial `ggplot()` call. * Controls our axes variables as well as graphical parameters such as color, size, shape .pull-left[ ```r ggplot(data = gapminder, * aes(x = year, y = lifeExp)) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-12-1.png) ] --- Now `ggplot` knows what to plot, but it doesn't know how to plot it yet. Let's add some points with `geom_point()`. * This is a new layer! We add layers using the `+` operator. .pull-left[ ```r ggplot(data = gapminder, aes(x = year, y = lifeExp)) + * geom_point() ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-14-1.png) ] --- Let's make our points smaller and red. .pull-left[ ```r ggplot(data = gapminder, aes(x = year, y = lifeExp)) + * geom_point(color = "red", size = 0.75) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-16-1.png) ] --- Let's try switching them to lines. .pull-left[ ```r ggplot(data = gapminder, aes(x = year, y = lifeExp)) + * geom_line(color = "red", size = 0.75) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-18-1.png) ] --- We want lines connected by country, not just in the order they appear in the data. .pull-left[ ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, * group = country)) + geom_line(color = "red", size = 0.5) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-20-1.png) ] --- We want to explore differences across continents, so let's color by continent * We use `aes()` because we want to color by something in our data * Putting a color within `aes()` will automatically add a label * We have to remove the color within `geom_line()`, or it will override the `aes()` .pull-left[ ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, * color = continent)) + * geom_line(size = 0.5) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-22-1.png) ] --- Let's add another layer. Trendlines by continent! * We want them grouped differently than our lines (by continent), so we use a new `aes()` * We will make them stick out by having them be thicker and black * We don't want error bars, so we will remove `se` * We will use the default option `loess`. (See `?geom_smooth()`) .pull-left[ ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + * geom_smooth(aes(group = continent), * se = FALSE, size = 1.5, * color = "black", * method = "loess") ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-24-1.png) ] --- This is cluttered and hard to read. Let's try separating by continents using **facets**! * We use `facet_wrap` * Takes in a **formula** object. Use a tilde `~` and then the variable name you want .pull-left[ ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + * facet_wrap(~ continent) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-26-1.png) ] --- Looking better! Now let's fine tune. First we'll formalize the labels on our plot using `labs()`. * Can also edit labels one at a time using `xlab()`, `ylab()`, `ggmain()`, ... * You should probably do this in every graph you present! Very rarely do you want the text styling of your data frame to match your output. Emphasis here on human readability! ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + facet_wrap(~ continent) + * labs(title = "Life expectancy over time by continent", * x = "Year", y = "Life Expectancy", * legend = "Continent") ``` --- .middler[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-28-1.png) ] --- Let's center our title by adjusting `theme()`. * `element_text()` tells ggplot how to display the text. Used for fine-tuning * `hjust` is our horizontal alignment, we set it to one half ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + facet_wrap(~ continent) + labs(title = "Life expectancy over time by continent", x = "Year", y = "Life Expectancy", legend = "Continent") + * theme(plot.title = element_text(hjust = 0.5, * face = "bold", * size = 14)) ``` --- .middler[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-30-1.png) ] --- Actually, that legend is redundant. Let's remove it. ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + facet_wrap(~ continent) + labs(title = "Life expectancy over time by continent", x = "Year", y = "Life Expectancy") + theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 14), * legend.position = "none") ``` --- .middler[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-32-1.png) ] --- I don't like the default gray background. I almost always set the `theme_bw()`. * There are several other theme options! Too many to list, so look them up if you want more options. ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + facet_wrap(~ continent) + labs(title = "Life expectancy over time by continent", x = "Year", y = "Life Expectancy") + theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 14), legend.position = "none") + * theme_bw() ``` --- .middler[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-34-1.png) ] --- This overwrote our custome `theme()` settings! Let's reorder the layers. ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + facet_wrap(~ continent) + labs(title = "Life expectancy over time by continent", x = "Year", y = "Life Expectancy") + * theme_bw() + * theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 14), * legend.position = "none") ``` --- .middler[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-36-1.png) ] --- We can make this more readable. Be careful of text that is too small! Let's increase all of our text proportionally using `base_size` within `theme_bw()`. * We could also do this by adjusting `text` within `theme()` * Note that we no longer need to manually adjust our title size. This will scale everything automatically. ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + facet_wrap(~ continent) + labs(title = "Life expectancy over time by continent", x = "Year", y = "Life Expectancy") + * theme_bw(base_size = 16) + * theme(plot.title = element_text(hjust = 0.5, face = "bold"), legend.position = "none") ``` --- .middler[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-38-1.png) ] --- Almost there! Now our text is a good size, but it overlaps. There are a few ways we could fix this. We'll rotate our text. ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + facet_wrap(~ continent) + labs(title = "Life expectancy over time by continent", x = "Year", y = "Life Expectancy") + theme_bw(base_size = 16) + theme(plot.title = element_text(hjust = 0.5, face = "bold"), legend.position = "none", * axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1)) ``` --- .middler[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-40-1.png) ] --- Lastly, let's space out our panels by adjusting `panel.spacing.x`. ```r ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + facet_wrap(~ continent) + labs(title = "Life expectancy over time by continent", x = "Year", y = "Life Expectancy") + theme_bw(base_size = 16) + theme(plot.title = element_text(hjust = 0.5, face = "bold"), legend.position = "none", axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1), * panel.spacing.x = unit(0.75, "cm")) ``` --- .middler[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-42-1.png) ] --- Great, that looks good! Now we can store it as an object. ```r *lifeExp_plot <- ggplot(data = gapminder, aes(x = year, y = lifeExp, group = country, color = continent)) + geom_line(size = 0.5) + geom_smooth(aes(group = continent), se = FALSE, size = 1.5, color = "black", method = "loess") + facet_wrap(~ continent) + labs(title = "Life expectancy over time by continent", x = "Year", y = "Life Expectancy") + theme_bw(base_size = 16) + theme(plot.title = element_text(hjust = 0.5, face = "bold"), legend.position = "none", axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1), panel.spacing.x = unit(0.75, "cm")) ``` --- Then we can plot it by just calling our object. ```r lifeExp_plot ``` .center[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-45-1.png) ] --- We can also save it in our `Figures` subfolder using `ggsave()`. * Set `height` and `width` parameters to automatically resize the image ```r ggsave(filename = "Figures/lifeExp_plot.pdf", plot = lifeExp_plot, height = 5, width = 7) ``` .center[**Never** save a figure from your analysis using screenshots or point-and-click! They will be lower quality and non-reproducible!] --- ## Some comments on `ggplot`: * What we just made was a *very* complicated and fine-tuned plot! * I have to Google how to adjust certain things all the time * So does the creator of `ggplot2` .center[![hadley](hadley.png)] --- ## A simpler example: Histogram .pull-left[ ```r *ggplot(data = gapminder, * aes(x = lifeExp)) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-48-1.png) ] --- ## A simpler example: Histogram .pull-left[ ```r ggplot(data = gapminder, aes(x = lifeExp)) + * geom_histogram() ``` ] .pull-right[ ``` ## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. ``` ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-50-1.png) ] --- ## A simpler example: Histogram .pull-left[ ```r ggplot(data = gapminder, aes(x = lifeExp)) + * geom_histogram(binwidth = 1) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-52-1.png) ] --- ## A simpler example: Histogram .pull-left[ ```r ggplot(data = gapminder, aes(x = lifeExp)) + geom_histogram(binwidth = 1, * color = "black", * fill = "lightblue") ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-54-1.png) ] --- ## A simpler example: Histogram .pull-left[ ```r ggplot(data = gapminder, aes(x = lifeExp)) + geom_histogram(binwidth = 1, color = "black", fill = "lightblue") + * theme_bw(base_size = 20) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-56-1.png) ] --- ## A simpler example: Histogram .pull-left[ ```r ggplot(data = gapminder, aes(x = lifeExp)) + geom_histogram(binwidth = 1, color = "black", fill = "lightblue") + theme_bw(base_size = 20) + * labs(x = "Life Expectancy", * y = "Count") ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-58-1.png) ] --- ## A simpler example: Boxplots .pull-left[ ```r *ggplot(data = gapminder, * aes(x = continent, y = lifeExp)) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-60-1.png) ] --- ## A simpler example: Boxplots .pull-left[ ```r ggplot(data = gapminder, aes(x = continent, y = lifeExp)) + * geom_boxplot() ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-62-1.png) ] --- ## A simpler example: Boxplots .pull-left[ ```r ggplot(data = gapminder, aes(x = continent, y = lifeExp)) + * geom_boxplot(fill = "lightblue") ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-64-1.png) ] --- ## A simpler example: Boxplots .pull-left[ ```r ggplot(data = gapminder, aes(x = continent, y = lifeExp)) + geom_boxplot(fill = "lightblue") + * theme_bw(base_size = 20) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-66-1.png) ] --- ## A simpler example: Boxplots .pull-left[ ```r ggplot(data = gapminder, aes(x = continent, y = lifeExp)) + geom_boxplot(fill = "lightblue") + theme_bw(base_size = 20) + * labs(title = "Life expectancy by Continent", * x = "", * y = "") ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-68-1.png) ] --- ## A simpler example: Boxplots .pull-left[ ```r ggplot(data = gapminder, aes(x = continent, y = lifeExp)) + geom_boxplot(fill = "lightblue") + theme_bw(base_size = 20) + labs(title = "Life expectancy by Continent", x = "", y = "") + * theme(plot.title = * element_text(hjust = 0.5)) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-70-1.png) ] --- ## A simpler example: Boxplots .pull-left[ ```r ggplot(data = gapminder, aes(x = continent, y = lifeExp)) + geom_boxplot(fill = "lightblue") + theme_bw(base_size = 20) + labs(title = "Life expectancy by Continent", x = "", y = "") + theme(plot.title = element_text(hjust = 0.5)) + * ylim(c(0, 85)) ``` ] .pull-right[ ![](lectureslides_datavizmanip_files/figure-html/unnamed-chunk-72-1.png) ] --- .pull-left[## Don'ts * Pie graphs, ever * 3D plots * Deceptive axes * Excessive labels * Excessive/bad coloring * Fancy shading/effects * Bad variable/axis names * Unreadable labels * Overloaded with information ] .pull-right[## Do's * Simple, clean graphics * Neat and human readable text * Appropriate data range (bar charts should *always* start from 0!) * Consistent intervals * Roughly ~6 colors or less * Size figures appropriately ] --- layout: false layout: true # Bad Visualizations! --- .center[] -- **No-no:** Pie charts! Eugh! The proportions are completely off! .pull-right[.center[]] --- .center[] -- **No-no:** Pie charts! Eugh! Percents don't add up! .pull-right[.center[]] --- .center[] -- **No-no:** 3d bar charts?! .pull-right[.center[]] --- .center[] -- **No-no:** Bad use of color .pull-right[.center[]] --- .center[] -- **No-no:** Bad axis, lack of information, 3D bar chart .pull-right[.center[]] --- .center[] -- **No-no:** Four numbers displayed as a cluttered chart, terrible labels, bad axis range .pull-right[.center[]] --- .center[] -- **No-no:** Deceptively flipped y-axis! (and excessive color) .pull-right[.center[]] --- .center[] .center[(This was presented in congress!)] -- **No-no:** Two axes in a single plot, bad axis range .pull-right[.center[]] --- .center[] -- **No-no:** Deceptive axis range (should start at 0) .pull-right[.center[]] --- .center[] .center[(From the Gates Foundation!)] -- **No-no:** Inconsistent x-axis intervals .pull-right[.center[]] --- layout: false # ggplot cheatsheet * Axes: `xlim()`, `ylim()` * Legends: within initial `aes()`, edit within `theme()` or `guides()` * `geom_point()`, `geom_line()`, `geom_histogram()`, `geom_bar()`, `geom_boxplot()`, `geom_text()` * `facet_grid()`, `facet_wrap()` for faceting * `labs()` for labels * `theme_bw()` to make things look nicer * Graphical parameters: `color` for color, `alpha` for opacity, `lwd`/`size` for thickness, `shape` for shape, `fill` for interior color, ... .pushdown[.center[[Much, much more! (Click me for a cheat sheet!)](https://rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf)]] --- class: inverse .sectionhead[Part 3: Data Manipulation] --- layout: true # <TT>select()</TT>: Column selection --- Use `select()` to choose certain columns. ```r gapminder %>% select(lifeExp, gdpPercap) ``` ``` ## # A tibble: 1,704 × 2 ## lifeExp gdpPercap ## <dbl> <dbl> ## 1 28.8 779. ## 2 30.3 821. ## 3 32.0 853. ## 4 34.0 836. ## 5 36.1 740. ## 6 38.4 786. ## 7 39.9 978. ## 8 40.8 852. ## 9 41.7 649. ## 10 41.8 635. ## # … with 1,694 more rows ``` --- Use `select()` to choose certain columns. We can also use `select()` to remove certain columns by putting a `-` symbol in front. ```r gapminder %>% select(-lifeExp, -gdpPercap) ``` ``` ## # A tibble: 1,704 × 4 ## country continent year pop ## <fct> <fct> <int> <int> ## 1 Afghanistan Asia 1952 8425333 ## 2 Afghanistan Asia 1957 9240934 ## 3 Afghanistan Asia 1962 10267083 ## 4 Afghanistan Asia 1967 11537966 ## 5 Afghanistan Asia 1972 13079460 ## 6 Afghanistan Asia 1977 14880372 ## 7 Afghanistan Asia 1982 12881816 ## 8 Afghanistan Asia 1987 13867957 ## 9 Afghanistan Asia 1992 16317921 ## 10 Afghanistan Asia 1997 22227415 ## # … with 1,694 more rows ``` --- ## Helper functions `select()` has a number of helper functions to select columns (see `?select`). Notably: * `starts_with()` for prefixes * `ends_with()` for suffixes * `contains()` for strings ```r gapminder %>% select(starts_with("co")) %>% head() ``` ``` ## # A tibble: 6 × 2 ## country continent ## <fct> <fct> ## 1 Afghanistan Asia ## 2 Afghanistan Asia ## 3 Afghanistan Asia ## 4 Afghanistan Asia ## 5 Afghanistan Asia ## 6 Afghanistan Asia ``` --- ## Helper functions `select()` has a number of helper functions to select columns (see `?select`). Notably: * `starts_with()` for prefixes * `ends_with()` for suffixes * `contains()` for strings ```r gapminder %>% select(ends_with("p")) %>% head() ``` ``` ## # A tibble: 6 × 3 ## lifeExp pop gdpPercap ## <dbl> <int> <dbl> ## 1 28.8 8425333 779. ## 2 30.3 9240934 821. ## 3 32.0 10267083 853. ## 4 34.0 11537966 836. ## 5 36.1 13079460 740. ## 6 38.4 14880372 786. ``` --- ## Helper functions `select()` has a number of helper functions to select columns (see `?select`). Notably: * `starts_with()` for prefixes * `ends_with()` for suffixes * `contains()` for strings ```r gapminder %>% select(contains("Per")) %>% head() ``` ``` ## # A tibble: 6 × 1 ## gdpPercap ## <dbl> ## 1 779. ## 2 821. ## 3 853. ## 4 836. ## 5 740. ## 6 786. ``` --- ## Helper functions `select()` has a number of helper functions to select columns (see `?select`). Notably: * `starts_with()` for prefixes * `ends_with()` for suffixes * `contains()` for strings This can be particularly helpful when you have data in "wide" format! (such as `category_01`, `category_02`, `category_03`, ...) --- layout: false layout: true # <TT>mutate()</TT>: create new columns Create and transform variables from existing variables using `mutate()`. `mutate(NEW_VAR_NAME = ...)`. --- ```r gapminder %>% mutate(gdp = gdpPercap * pop) %>% head() ``` ``` ## # A tibble: 6 × 7 ## country continent year lifeExp pop gdpPercap gdp ## <fct> <fct> <int> <dbl> <int> <dbl> <dbl> ## 1 Afghanistan Asia 1952 28.8 8425333<PHONE_NUMBER>330. ## 2 Afghanistan Asia 1957 30.3 9240934<PHONE_NUMBER>670. ## 3 Afghanistan Asia 1962 32.0 10267083<PHONE_NUMBER>797. ## 4 Afghanistan Asia 1967 34.0 11537966<PHONE_NUMBER>150. ## 5 Afghanistan Asia 1972 36.1 13079460<PHONE_NUMBER>274. ## 6 Afghanistan Asia 1977 38.4 14880372<PHONE_NUMBER>9231. ``` --- Note that we can use existing columns, including those we created within the same call to `mutate()`. ```r gapminder %>% mutate(gdp = gdpPercap * pop, logGDP = log(gdp)) %>% head() ``` ``` ## # A tibble: 6 × 8 ## country continent year lifeExp pop gdpPercap gdp logGDP ## <fct> <fct> <int> <dbl> <int> <dbl> <dbl> <dbl> ## 1 Afghanistan Asia 1952 28.8 8425333<PHONE_NUMBER>330. 22.6 ## 2 Afghanistan Asia 1957 30.3 9240934<PHONE_NUMBER>670. 22.7 ## 3 Afghanistan Asia 1962 32.0 10267083<PHONE_NUMBER>797. 22.9 ## 4 Afghanistan Asia 1967 34.0 11537966<PHONE_NUMBER>150. 23.0 ## 5 Afghanistan Asia 1972 36.1 13079460<PHONE_NUMBER>274. 23.0 ## 6 Afghanistan Asia 1977 38.4 14880372<PHONE_NUMBER>9231. 23.2 ``` --- layout: false layout: true # <TT>ifelse()</TT>: conditional selection --- `ifelse()` takes in a logical test and conditional responses, and returns a vector of values based on the output of the test. It can be very useful for data cleaning (among other uses)! `ifelse(test, yes, no)` * `test`: the logical test * `yes`: return values for when `test` is `TRUE` * `no`: return values for when `test` is `FALSE` ```r demo <- -2:2 ifelse(demo > 0, "strictly positive", "not strictly positive") ``` ``` ## [1] "not strictly positive" "not strictly positive" "not strictly positive" ## [4] "strictly positive" "strictly positive" ``` --- `ifelse()` can be very useful within `mutate()`. For example, if we want to use the country code `USA` instead of `United States`, and store this variable as `country_clean`, we can use: ```r gapminder %>% mutate(country_clean = ifelse(country == "United States", "USA", as.character(country))) %>% filter(year == 2007, continent == "Americas") %>% select(country, country_clean, lifeExp, gdpPercap) %>% tail() ``` ``` ## # A tibble: 6 × 4 ## country country_clean lifeExp gdpPercap ## <fct> <chr> <dbl> <dbl> ## 1 Peru Peru 71.4 7409. ## 2 Puerto Rico Puerto Rico 78.7 19329. ## 3 Trinidad and Tobago Trinidad and Tobago 69.8 18009. ## 4 United States USA 78.2 42952. ## 5 Uruguay Uruguay 76.4 10611. ## 6 Venezuela Venezuela 73.7 11416. ``` --- layout: false layout: true # <TT>%in%</TT>: value matching `%in%` is a binary operator, which returns a boolean vector indicating whether components in the left-hand side are found in the right-hand side. --- ```r 1 %in% 1:5 ``` ``` ## [1] TRUE ``` ```r 1 %in% -1:-5 ``` ``` ## [1] FALSE ``` ```r c(0, 1, 2, 7) %in% 1:5 ``` ``` ## [1] FALSE TRUE TRUE FALSE ``` --- To negate the `%in%` operator, wrap the entire logical statement within `!(...)`. ```r !(1 %in% 1:5) ``` ``` ## [1] FALSE ``` ```r !(1 %in% -1:-5) ``` ``` ## [1] TRUE ``` ```r !(c(0, 1, 2, 7) %in% 1:5) ``` ``` ## [1] TRUE FALSE FALSE TRUE ``` --- ```r gapminder %>% filter(continent %in% c("Americas", "Europe")) %>% filter(year %in% c(2002, 2007)) %>% head() ``` ``` ## # A tibble: 6 × 6 ## country continent year lifeExp pop gdpPercap ## <fct> <fct> <int> <dbl> <int> <dbl> ## 1 Albania Europe 2002 75.7 3508512 4604. ## 2 Albania Europe 2007 76.4 3600523 5937. ## 3 Argentina Americas 2002 74.3 38331121 8798. ## 4 Argentina Americas 2007 75.3 40301927 12779. ## 5 Austria Europe 2002 79.0 8148312 32418. ## 6 Austria Europe 2007 79.8 8199783 36126. ``` --- layout: false layout: true # split-apply-combine --- *split-apply-combine* is a data analysis strategy where you *split* the data up into pieces, *apply* some operation on each piece, and then *combine* all the pieces back together. It's useful for breaking big problems into smaller manageable chunks! --- ## `group_by()` You can use `group_by()` to define a grouping of the rows of your data based on the columns. Notice that it doesn't change our data, except for that we can now see that it has 5 groups. ```r grouped_gap <- gapminder %>% group_by(continent) class(grouped_gap) ``` ``` ## [1] "grouped_df" "tbl_df" "tbl" "data.frame" ``` ```r grouped_gap ``` ``` ## # A tibble: 1,704 × 6 ## # Groups: continent [5] ## country continent year lifeExp pop gdpPercap ## <fct> <fct> <int> <dbl> <int> <dbl> ## 1 Afghanistan Asia 1952 28.8 8425333 779. ## 2 Afghanistan Asia 1957 30.3 9240934 821. ## 3 Afghanistan Asia 1962 32.0 10267083 853. ## 4 Afghanistan Asia 1967 34.0 11537966 836. ## 5 Afghanistan Asia 1972 36.1 13079460 740. ## 6 Afghanistan Asia 1977 38.4 14880372 786. ## 7 Afghanistan Asia 1982 39.9 12881816 978. ## 8 Afghanistan Asia 1987 40.8 13867957 852. ## 9 Afghanistan Asia 1992 41.7 16317921 649. ## 10 Afghanistan Asia 1997 41.8 22227415 635. ## # … with 1,694 more rows ``` --- ## `group_by()` You can use `group_by()` to define a grouping of the rows of your data based on the columns. We can remove the groups with `ungroup()`. ```r ungrouped_gap <- ungroup(grouped_gap) class(ungrouped_gap) ``` ``` ## [1] "tbl_df" "tbl" "data.frame" ``` ```r ungrouped_gap ``` ``` ## # A tibble: 1,704 × 6 ## country continent year lifeExp pop gdpPercap ## <fct> <fct> <int> <dbl> <int> <dbl> ## 1 Afghanistan Asia 1952 28.8 8425333 779. ## 2 Afghanistan Asia 1957 30.3 9240934 821. ## 3 Afghanistan Asia 1962 32.0 10267083 853. ## 4 Afghanistan Asia 1967 34.0 11537966 836. ## 5 Afghanistan Asia 1972 36.1 13079460 740. ## 6 Afghanistan Asia 1977 38.4 14880372 786. ## 7 Afghanistan Asia 1982 39.9 12881816 978. ## 8 Afghanistan Asia 1987 40.8 13867957 852. ## 9 Afghanistan Asia 1992 41.7 16317921 649. ## 10 Afghanistan Asia 1997 41.8 22227415 635. ## # … with 1,694 more rows ``` --- ## `summarize()` `summarize()` (or `summarise()`, if you prefer) will apply functions to rows of a data frame. If a data frame is grouped, the function will be applied by group. ```r gapminder %>% group_by(continent) %>% summarize(mean_lifeExp = mean(lifeExp, na.rm = TRUE), max_gdp = max(gdpPercap)) ``` ``` ## # A tibble: 5 × 3 ## continent mean_lifeExp max_gdp ## <fct> <dbl> <dbl> ## 1 Africa 48.9 21951. ## 2 Americas 64.7 42952. ## 3 Asia 60.1 113523. ## 4 Europe 71.9 49357. ## 5 Oceania 74.3 34435. ``` Notice that this creates an entirely new (and much smaller) data frame. Typically we want to store this object as a variable, but not as the same variable as our data! --- ## `arrange()` We can order the rows of the data using `arrange()`. Usually, you do this after some call to `summarize()`. ```r gapminder %>% group_by(continent) %>% summarize(mean_lifeExp = mean(lifeExp, na.rm = TRUE), max_gdp = max(gdpPercap)) %>% arrange(mean_lifeExp) ``` ``` ## # A tibble: 5 × 3 ## continent mean_lifeExp max_gdp ## <fct> <dbl> <dbl> ## 1 Africa 48.9 21951. ## 2 Asia 60.1 113523. ## 3 Americas 64.7 42952. ## 4 Europe 71.9 49357. ## 5 Oceania 74.3 34435. ``` --- ## `arrange()` We can order the rows of the data using `arrange()`. Usually, you do this after some call to `summarize()`. We can use `desc()` to put in decreasing order. ```r gapminder %>% group_by(continent) %>% summarize(mean_lifeExp = mean(lifeExp, na.rm = TRUE), max_gdp = max(gdpPercap)) %>% arrange(desc(mean_lifeExp)) ``` ``` ## # A tibble: 5 × 3 ## continent mean_lifeExp max_gdp ## <fct> <dbl> <dbl> ## 1 Oceania 74.3 34435. ## 2 Europe 71.9 49357. ## 3 Americas 64.7 42952. ## 4 Asia 60.1 113523. ## 5 Africa 48.9 21951. ``` --- ## `count()` If we want to count by groups, we can use the notation we've already earned. ```r gapminder %>% group_by(continent) %>% summarize(count = n()) ``` ``` ## # A tibble: 5 × 2 ## continent count ## <fct> <int> ## 1 Africa 624 ## 2 Americas 300 ## 3 Asia 396 ## 4 Europe 360 ## 5 Oceania 24 ``` --- ## `count()` Alternatively, we can use the shorthand `count()`, with optional argument `sort` to order. ```r gapminder %>% count(continent, sort = FALSE) ``` ``` ## # A tibble: 5 × 2 ## continent n ## <fct> <int> ## 1 Africa 624 ## 2 Americas 300 ## 3 Asia 396 ## 4 Europe 360 ## 5 Oceania 24 ``` --- ## `count()` We can also count combinations of categories by supplying multiple variables to `count()`. ```r gapminder %>% count(continent, country) ``` ``` ## # A tibble: 142 × 3 ## continent country n ## <fct> <fct> <int> ## 1 Africa Algeria 12 ## 2 Africa Angola 12 ## 3 Africa Benin 12 ## 4 Africa Botswana 12 ## 5 Africa Burkina Faso 12 ## 6 Africa Burundi 12 ## 7 Africa Cameroon 12 ## 8 Africa Central African Republic 12 ## 9 Africa Chad 12 ## 10 Africa Comoros 12 ## # … with 132 more rows ``` --- ## `count()` We can also count combinations of categories by supplying multiple variables to `count()`, we can then sort using `arrange()`. ```r gapminder %>% count(continent, country) %>% arrange(country, desc(n)) ``` ``` ## # A tibble: 142 × 3 ## continent country n ## <fct> <fct> <int> ## 1 Asia Afghanistan 12 ## 2 Europe Albania 12 ## 3 Africa Algeria 12 ## 4 Africa Angola 12 ## 5 Americas Argentina 12 ## 6 Oceania Australia 12 ## 7 Europe Austria 12 ## 8 Asia Bahrain 12 ## 9 Asia Bangladesh 12 ## 10 Europe Belgium 12 ## # … with 132 more rows ``` --- layout:false # <TT>pull()</TT>: extract column as vector You can use `pull()` to extract a single column as a vector. Notice the difference between ```r gapminder %>% select(lifeExp) %>% head(4) ``` ``` ## # A tibble: 4 × 1 ## lifeExp ## <dbl> ## 1 28.8 ## 2 30.3 ## 3 32.0 ## 4 34.0 ``` ```r gapminder %>% pull(lifeExp) %>% head(10) ``` ``` ## [1] 28.801 30.332 31.997 34.020 36.088 38.438 39.854 40.822 41.674 41.763 ``` --- # <TT>rename()</TT>: ...renaming! `rename(data, NEW_VAR_NAME = OLD_VAR_NAME)` ```r gapminder %>% rename(life_exp = lifeExp) ``` ``` ## # A tibble: 1,704 × 6 ## country continent year life_exp pop gdpPercap ## <fct> <fct> <int> <dbl> <int> <dbl> ## 1 Afghanistan Asia 1952 28.8 8425333 779. ## 2 Afghanistan Asia 1957 30.3 9240934 821. ## 3 Afghanistan Asia 1962 32.0 10267083 853. ## 4 Afghanistan Asia 1967 34.0 11537966 836. ## 5 Afghanistan Asia 1972 36.1 13079460 740. ## 6 Afghanistan Asia 1977 38.4 14880372 786. ## 7 Afghanistan Asia 1982 39.9 12881816 978. ## 8 Afghanistan Asia 1987 40.8 13867957 852. ## 9 Afghanistan Asia 1992 41.7 16317921 649. ## 10 Afghanistan Asia 1997 41.8 22227415 635. ## # … with 1,694 more rows ``` --- layout: true # Re-arranging Data --- ## `pivot_longer()` Let's load the `relig_income` data from tidyverse. ```r data(relig_income) head(relig_income) ``` ``` ## # A tibble: 6 × 11 ## religion `<$10k` `$10-20k` `$20-30k` `$30-40k` `$40-50k` `$50-75k` `$75-100k` ## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 Agnostic 27 34 60 81 76 137 122 ## 2 Atheist 12 27 37 52 35 70 73 ## 3 Buddhist 27 21 30 34 33 58 62 ## 4 Catholic 418 617 732<PHONE_NUMBER> 949 ## 5 Don’t kn… 15 14 15 11 10 35 21 ## 6 Evangeli…<PHONE_NUMBER><PHONE_NUMBER> 949 ## # … with 3 more variables: $100-150k <dbl>, >150k <dbl>, ## # Don't know/refused <dbl> ``` --- ## `pivot_longer()` We can use `pivot_longer()` to go from data in "wide" form to data in "long" form. ```r relig_income %>% pivot_longer(contains("$"), names_to = "income", values_to = "count") ``` ``` ## # A tibble: 144 × 5 ## religion `>150k` `Don't know/refused` income count ## <chr> <dbl> <dbl> <chr> <dbl> ## 1 Agnostic 84 96 <$10k 27 ## 2 Agnostic 84 96 $10-20k 34 ## 3 Agnostic 84 96 $20-30k 60 ## 4 Agnostic 84 96 $30-40k 81 ## 5 Agnostic 84 96 $40-50k 76 ## 6 Agnostic 84 96 $50-75k 137 ## 7 Agnostic 84 96 $75-100k 122 ## 8 Agnostic 84 96 $100-150k 109 ## 9 Atheist 74 76 <$10k 12 ## 10 Atheist 74 76 $10-20k 27 ## # … with 134 more rows ``` --- ## `pivot_longer()` Looks like we missed a few of the income column names. Let's use matches with a regular expression. ```r relig_income %>% pivot_longer(matches("\\$|150|refused"), names_to = "income", values_to = "count") ``` ``` ## # A tibble: 180 × 3 ## religion income count ## <chr> <chr> <dbl> ## 1 Agnostic <$10k 27 ## 2 Agnostic $10-20k 34 ## 3 Agnostic $20-30k 60 ## 4 Agnostic $30-40k 81 ## 5 Agnostic $40-50k 76 ## 6 Agnostic $50-75k 137 ## 7 Agnostic $75-100k 122 ## 8 Agnostic $100-150k 109 ## 9 Agnostic >150k 84 ## 10 Agnostic Don't know/refused 96 ## # … with 170 more rows ``` --- ## `pivot_longer()` Let's load the `billboard` data from tidyverse. ```r data(billboard) billboard ``` ``` ## # A tibble: 317 × 79 ## artist track date.entered wk1 wk2 wk3 wk4 wk5 wk6 wk7 wk8 ## <chr> <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 2 Pac Baby D… 2000-02-26 87 82 72 77 87 94 99 NA ## 2 2Ge+her The Ha… 2000-09-02 91 87 92 NA NA NA NA NA ## 3 3 Doors… Krypto… 2000-04-08 81 70 68 67 66 57 54 53 ## 4 3 Doors… Loser 2000-10-21 76 76 72 69 67 65 55 59 ## 5 504 Boyz Wobble… 2000-04-15 57 34 25 17 17 31 36 49 ## 6 98^0 Give M… 2000-08-19 51 39 34 26 26 19 2 2 ## 7 A*Teens Dancin… 2000-07-08 97 97 96 95 100 NA NA NA ## 8 Aaliyah I Don'… 2000-01-29 84 62 51 41 38 35 35 38 ## 9 Aaliyah Try Ag… 2000-03-18 59 53 38 28 21 18 16 14 ## 10 Adams, … Open M… 2000-08-26 76 76 74 69 68 67 61 58 ## # … with 307 more rows, and 68 more variables: wk9 <dbl>, wk10 <dbl>, ## # wk11 <dbl>, wk12 <dbl>, wk13 <dbl>, wk14 <dbl>, wk15 <dbl>, wk16 <dbl>, ## # wk17 <dbl>, wk18 <dbl>, wk19 <dbl>, wk20 <dbl>, wk21 <dbl>, wk22 <dbl>, ## # wk23 <dbl>, wk24 <dbl>, wk25 <dbl>, wk26 <dbl>, wk27 <dbl>, wk28 <dbl>, ## # wk29 <dbl>, wk30 <dbl>, wk31 <dbl>, wk32 <dbl>, wk33 <dbl>, wk34 <dbl>, ## # wk35 <dbl>, wk36 <dbl>, wk37 <dbl>, wk38 <dbl>, wk39 <dbl>, wk40 <dbl>, ## # wk41 <dbl>, wk42 <dbl>, wk43 <dbl>, wk44 <dbl>, wk45 <dbl>, wk46 <dbl>, … ``` --- ## `pivot_longer()` ```r billboard %>% pivot_longer( cols = starts_with("wk"), names_to = "week", names_prefix = "wk", values_to = "rank", values_drop_na = TRUE ) ``` ``` ## # A tibble: 5,307 × 5 ## artist track date.entered week rank ## <chr> <chr> <date> <chr> <dbl> ## 1 2 Pac Baby Don't Cry (Keep... 2000-02-26 1 87 ## 2 2 Pac Baby Don't Cry (Keep... 2000-02-26 2 82 ## 3 2 Pac Baby Don't Cry (Keep... 2000-02-26 3 72 ## 4 2 Pac Baby Don't Cry (Keep... 2000-02-26 4 77 ## 5 2 Pac Baby Don't Cry (Keep... 2000-02-26 5 87 ## 6 2 Pac Baby Don't Cry (Keep... 2000-02-26 6 94 ## 7 2 Pac Baby Don't Cry (Keep... 2000-02-26 7 99 ## 8 2Ge+her The Hardest Part Of ... 2000-09-02 1 91 ## 9 2Ge+her The Hardest Part Of ... 2000-09-02 2 87 ## 10 2Ge+her The Hardest Part Of ... 2000-09-02 3 92 ## # … with 5,297 more rows ``` --- ## `pivot_wider()` Let's load the `fish_encounters` data from tidyverse. ```r data(fish_encounters) head(fish_encounters) ``` ``` ## # A tibble: 6 × 3 ## fish station seen ## <fct> <fct> <int> ## 1 4842 Release 1 ## 2 4842 I80_1 1 ## 3 4842 Lisbon 1 ## 4 4842 Rstr 1 ## 5 4842 Base_TD 1 ## 6 4842 BCE 1 ``` --- ## `pivot_wider()` We can use `pivot_wider()` to go from data in "long" form to data in "wide" form. ```r fish_encounters %>% pivot_wider(names_from = station, values_from = seen) ``` ``` ## # A tibble: 19 × 12 ## fish Release I80_1 Lisbon Rstr Base_TD BCE BCW BCE2 BCW2 MAE MAW ## <fct> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> ## 1 4842 1 1 1 1 1 1 1 1 1 1 1 ## 2 4843 1 1 1 1 1 1 1 1 1 1 1 ## 3 4844 1 1 1 1 1 1 1 1 1 1 1 ## 4 4845 1 1 1 1 1 NA NA NA NA NA NA ## 5 4847 1 1 1 NA NA NA NA NA NA NA NA ## 6 4848 1 1 1 1 NA NA NA NA NA NA NA ## 7 4849 1 1 NA NA NA NA NA NA NA NA NA ## 8 4850 1 1 NA 1 1 1 1 NA NA NA NA ## 9 4851 1 1 NA NA NA NA NA NA NA NA NA ## 10 4854 1 1 NA NA NA NA NA NA NA NA NA ## 11 4855 1 1 1 1 1 NA NA NA NA NA NA ## 12 4857 1 1 1 1 1 1 1 1 1 NA NA ## 13 4858 1 1 1 1 1 1 1 1 1 1 1 ## 14 4859 1 1 1 1 1 NA NA NA NA NA NA ## 15 4861 1 1 1 1 1 1 1 1 1 1 1 ## 16 4862 1 1 1 1 1 1 1 1 1 NA NA ## 17 4863 1 1 NA NA NA NA NA NA NA NA NA ## 18 4864 1 1 NA NA NA NA NA NA NA NA NA ## 19 4865 1 1 1 NA NA NA NA NA NA NA NA ``` --- ## `pivot_wider()` ```r fish_encounters %>% pivot_wider( names_from = station, values_from = seen, values_fill = list(seen = 0) ) ``` ``` ## # A tibble: 19 × 12 ## fish Release I80_1 Lisbon Rstr Base_TD BCE BCW BCE2 BCW2 MAE MAW ## <fct> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> ## 1 4842 1 1 1 1 1 1 1 1 1 1 1 ## 2 4843 1 1 1 1 1 1 1 1 1 1 1 ## 3 4844 1 1 1 1 1 1 1 1 1 1 1 ## 4 4845 1 1 1 1 1 0 0 0 0 0 0 ## 5 4847 1 1 1 0 0 0 0 0 0 0 0 ## 6 4848 1 1 1 1 0 0 0 0 0 0 0 ## 7 4849 1 1 0 0 0 0 0 0 0 0 0 ## 8 4850 1 1 0 1 1 1 1 0 0 0 0 ## 9 4851 1 1 0 0 0 0 0 0 0 0 0 ## 10 4854 1 1 0 0 0 0 0 0 0 0 0 ## 11 4855 1 1 1 1 1 0 0 0 0 0 0 ## 12 4857 1 1 1 1 1 1 1 1 1 0 0 ## 13 4858 1 1 1 1 1 1 1 1 1 1 1 ## 14 4859 1 1 1 1 1 0 0 0 0 0 0 ## 15 4861 1 1 1 1 1 1 1 1 1 1 1 ## 16 4862 1 1 1 1 1 1 1 1 1 0 0 ## 17 4863 1 1 0 0 0 0 0 0 0 0 0 ## 18 4864 1 1 0 0 0 0 0 0 0 0 0 ## 19 4865 1 1 1 0 0 0 0 0 0 0 0 ``` --- ## `pivot_wider()` Let's load the `us_rent_income` data from tidyverse. ```r data(us_rent_income) head(us_rent_income) ``` ``` ## # A tibble: 6 × 5 ## GEOID NAME variable estimate moe ## <chr> <chr> <chr> <dbl> <dbl> ## 1 01 Alabama income 24476 136 ## 2 01 Alabama rent 747 3 ## 3 02 Alaska income 32940 508 ## 4 02 Alaska rent 1200 13 ## 5 04 Arizona income 27517 148 ## 6 04 Arizona rent 972 4 ``` --- ## `pivot_wider()` ```r us_rent_income %>% pivot_wider(names_from = variable, values_from = c(estimate, moe)) ``` ``` ## # A tibble: 52 × 6 ## GEOID NAME estimate_income estimate_rent moe_income moe_rent ## <chr> <chr> <dbl> <dbl> <dbl> <dbl> ## 1 01 Alabama 24476 747 136 3 ## 2 02 Alaska 32940 1200 508 13 ## 3 04 Arizona 27517 972 148 4 ## 4 05 Arkansas 23789 709 165 5 ## 5 06 California 29454 1358 109 3 ## 6 08 Colorado 32401 1125 109 5 ## 7 09 Connecticut 35326 1123 195 5 ## 8 10 Delaware 31560 1076 247 10 ## 9 11 District of Columbia 43198 1424 681 17 ## 10 12 Florida 25952 1077 70 3 ## # … with 42 more rows ``` --- layout: false layout: true # Joining Data --- We can use SQL-like join statements in R! * `inner_join(x, y, by = "key")`: match observations only when exact keys are equal * `left_join(x, y, by = "key")`: keep all observations in `x`, match observations in `y` by keys, `NA` otherwise * `right_join(x, y, by = "key")`: keep all observations in `y`, match observations in `x` by keys, `NA` otherwise * `outer_join(x, y, by = "key")`: keep all observations in `x` and `y`, match keys where possible, `NA` otherwise .footnote[Usually, `left_join()` will suffice!] --- .center[] .center[] .footnote[Images courtesy of Hadley Wickham. ([Link](https://r4ds.had.co.nz/relational-data.html))] --- layout: false # dplyr cheatsheet * `filter()` subset rows * `select()` subset columns, use with `contains()`, `starts_with()`, `ends_with()`, ... * `mutate()` create columns * `group_by()`, `summarize()`, `count()` group and summarize groups * `rename()` rename columns * `pivot_longer()`, `pivot_wider()` reshape data * `inner_join()`, `left_join()`, `right_join()`, `outer_join()` combine data (like SQL) .pushdown[.center[[Much, much more! (Click me for a cheat sheet!)](https://rstudio.com/resources/cheatsheets/)]]


pips Red=135 White=114
(CorrectAnswer= 0/0, ErrorScore= 0)
Outside in the gardens of Harbinger Hall the autumn colours were truly magnificent and a carpet of leaves lay on the ground. The players in the library may have taken notice of nature’s beauty but in truth, they were more focused on the board in front of them.
In the box sat the excitable Quentin Quickcube. “Well, my friends, you have chosen a very bad time to fan. I won’t play on for the gammon but if each of you would kindly pay me two points we can move on to the next game.” So saying, he pushed the four cubes set on 4 across the board.
Cautious Cuthbert was first to speak. “Well, you can have two points from me, QQ. Much better than paying you eight in a few minutes time.
Barry Bigplay now entered the conversation. “As you know there is nothing I like better than a big play but I think that even I will have to go quietly on this particular occasion. I can’t see how we can win this one.”
“Graves, a little more tea if you please,” Said the Dowager Duchess. “I hate dropping, particularly against QQ, but things do look bleak. As usual I will follow your lead, EE. What say you?”
The Enigmatic Englishman had remained silent while all this was going on but now he too, entered the debate. “I think you are all drinking from half-empty glasses.  Let’s look at the positives: we have a 21-pip lead in the race and we have a five-point home board to QQ’s two point board.
“Admittedly only a 55 from QQ leaves us a direct shot next turn but he cannot execute a normal blitz, precisely because of our five-point home board. If we manage to hit a shot it will very likely be a winning hit. Because QQ will have to exercise caution quite often we will get anchor somewhere in QQ’s board and then win from there.
“We will win a fair percentage of gammons but I wager we will the game 30% of the time. That makes this a comfortable take and so, I accept your redouble, QQ.”
“Exactly as I thought,” said DD. “Obviously I take as well.”
In the box sat the excitable Quentin Quickcube. “Well, my friends, you have chosen a very bad time to fan. I won’t play on for the gammon but if each of you would kindly pay me two points we can move on to the next game.” So saying, he pushed the four cubes set on 4 across the board.
Cautious Cuthbert was first to speak. “Well, you can have two points from me, QQ. Much better than paying you eight in a few minutes time.
Barry Bigplay now entered the conversation. “As you know there is nothing I like better than a big play but I think that even I will have to go quietly on this particular occasion. I can’t see how we can win this one.”
“Graves, a little more tea if you please,” Said the Dowager Duchess. “I hate dropping, particularly against QQ, but things do look bleak. As usual I will follow your lead, EE. What say you?”
The Enigmatic Englishman had remained silent while all this was going on but now he too, entered the debate. “I think you are all drinking from half-empty glasses.  Let’s look at the positives: we have a 21-pip lead in the race and we have a five-point home board to QQ’s two point board.
“Admittedly only a 55 from QQ leaves us a direct shot next turn but he cannot execute a normal blitz, precisely because of our five-point home board. If we manage to hit a shot it will very likely be a winning hit. Because QQ will have to exercise caution quite often we will get anchor somewhere in QQ’s board and then win from there.
“We will win a fair percentage of gammons but I wager we will the game 30% of the time. That makes this a comfortable take and so, I accept your redouble, QQ.”
“Exactly as I thought,” said DD. “Obviously I take as well.”
Cube analysis 2-ply cubeless equity +0.470 0.681 0.237 0.006 - 0.319 0.133 0.002 Cubeful equities: 1. Double, take +0.726 2. Double, pass +1.000 (+0.274) 3. No double +0.715 (-0.012) Proper cube action: Redouble, take


yes•ter•year
n.
usage:
Why not take a trip through yesteryear? You will be surprised at what you remember!
You have 323 date-centric memories and 153 non-date-centric memories attached to this year.
You have 10 date-centric memories and 7 non-date-centric memories attached to this year.
You have 19 date-centric memories and 4 non-date-centric memories attached to this year.
You have 15 date-centric memories and 10 non-date-centric memories attached to this year.
You have 8 date-centric memories and 5 non-date-centric memories attached to this year.
You have 5 date-centric memories and 2 non-date-centric memories attached to this year.
You have 35 date-centric and 6 non- date-centric memories attached to this year.


IObit Unlocker is an ideal tool to unlock files/folders used by another program or user, especially when you try to delete them. It releases files/folders from being occupied by programs and allows you to quickly remove or modify files/folders.
Please refer to below to use IObit Unlocker.
You can start the program by right clicking on files/folders and then selecting IObit Unlocker or simply double clicking the IObit Unlocker shortcut and then add files/folders.
The program supports drag and drop files/folders to unlock, in addition to clicking the Add button.
We provide five options for locked files/folders. You can directly unlock it or click the drop down button next to Unlock button to choose another advanced action: Unlock & Delete, Unlock & Rename, Unlock & Move, or Unlock & Copy.
By selecting Unlock & Delete, the program will delete the locked file/folder directly.
By selecting Unlock & Rename, it will open a new window. You only need to enter the new name and then click Unlock & Rename button.
If you want to rename more than 1 file/folder at a time, please select each file and enter the new name separately, then click Apply Button. After rename all files/folders, please click Unlock & Rename button.
By selecting Unlock & Move, the program will move this locked file/folder to the destination folder you specified. You can not find the file/folder in original place.
By selecting Unlock & Copy, the program will copy this locked file/folder to the destination folder you specified.
If you failed to unlock file/folder in normal mode, please tick the box before Forced Mode to enable this function. Forced Mode will terminate all related processes.
Click hereto visit Online Support Center. An Internet connection is required.
Click hereto view the IObit Unlocker End User License Agreement ("EULA").


a factory
[40, 70]
|
the Stoate Building
[41, 70]
|
a factory
[42, 70]
|
Moxham Grove
[43, 70]
|
Pearcy Bank
[44, 70]
|
the Merewether Monument
[45, 70]
|
Marston Way
[46, 70]
|
a warehouse
[47, 70]
|
St Paul's Church
[48, 70]
|
the Jenys Building
[49, 70]
|
Bragge Cinema
[40, 71]
|
the Streets Building
[41, 71]
|
Clelford Square
[42, 71]
|
Gawen Grove
[43, 71]
|
Dineen Park
[44, 71]
|
Chetwind Lane
[45, 71]
|
Reid Square
[46, 71]
|
the Osler Building
[47, 71]
|
Larkins Square
[48, 71]
|
a carpark
[49, 71]
|
the Bruford Building
[40, 72]
|
the Honeybone Building
[41, 72]
|
Attkings Square
[42, 72]
|
Swithun General Hospital
[43, 72]
|
Earle Towers
[44, 72]
|
Thomson Lane
[45, 72]
|
the Wagner Building
[46, 72]
|
Whittaker Boulevard Fire Station
[47, 72]
|
Kentisber Plaza
[48, 72]
|
Bythesea Drive
[49, 72]
|
St Matheos's Hospital
[40, 73]
|
Rhodes Park
[41, 73]
|
Cullingford Road Railway Station
[42, 73]
|
Durand Drive
[43, 73]
|
Hibbert Place
[44, 73]
|
Longmate Walk
[45, 73]
|
St Luke's Hospital
[46, 73]
|
the Byfield Museum
[47, 73]
|
Douglass Park
[48, 73]
|
Cread Boulevard School
[49, 73]
|
Millbanks Way
[40, 74]
|
the Boobyer Building
[41, 74]
|
Gilson Plaza
[42, 74]
|
the Sayce Building
[43, 74]
|
the Shartman Monument
[44, 74]
|
the Bainton Arms
[45, 74]
|
Morrhall Drive Fire Station
[46, 74]
|
Brookman Alley
[47, 74]
|
Haag Plaza Police Dept
[48, 74]
|
Hobbs Row
[49, 74]
|
Sherston Grove Fire Station
[40, 75]
|
wasteland
[41, 75]
|
Zuryk Bank
[42, 75]
|
the Crang Building
[43, 75]
|
Brimacombe Grove
[44, 75]
|
a warehouse
[45, 75]
|
Dix Place
[46, 75]
|
Sabine Towers
[47, 75]
|
Florence Lane
[48, 75]
|
Gullifer Walk
[49, 75]
|
Prankhard Plaza
[40, 76]
|
a factory
[41, 76]
|
Clay Place
[42, 76]
|
the Passant Monument
[43, 76]
|
Beastall Drive
[44, 76]
|
Osbert Bank
[45, 76]
|
a warehouse
[46, 76]
|
Compton Park
[47, 76]
|
Beville Auto Repair
[48, 76]
|
Rugg Auto Repair
[49, 76]
|
a factory
[40, 77]
|
Fearns Grove
[41, 77]
|
Kenworthy Plaza
[42, 77]
|
Bonfield Alley
[43, 77]
|
St Piran's Church
[44, 77]
|
Snelgrove Way
[45, 77]
|
St Emelia's Church
[46, 77]
|
the Kene Building
[47, 77]
|
Pester Square
[48, 77]
|
Hayte Library
[49, 77]
|
Laverton Walk
[40, 78]
|
the Chaffin Building
[41, 78]
|
Hills Drive
[42, 78]
|
Clanfield Boulevard
[43, 78]
|
Garven Drive
[44, 78]
|
Merewether Park
[45, 78]
|
Templeman Auto Repair
[46, 78]
|
Priestly Street Fire Station
[47, 78]
|
Triggs Auto Repair
[48, 78]
|
St Cyprian's Church
[49, 78]
|
the Ikiff Motel
[40, 79]
|
the Waggott Monument
[41, 79]
|
Humphreys Boulevard
[42, 79]
|
Club Townsend
[43, 79]
|
Club Broadbelt
[44, 79]
|
the Winwright Building
[45, 79]
|
the Lewen Museum
[46, 79]
|
a carpark
[47, 79]
|
Tutcher Place
[48, 79]
|
the Deny Hotel
[49, 79]
|
|
Menu
City Map
Find Location
Route Finder
World View
Map Mirror
|


Survey Questions
About You
Name (Required)
Link to Photo Image (Required)
Submit
×
Best Meet U Match


video:true
Toggle Navigation
Home
Writings
- Diary
- Poem
Arts
- Drawings
- Photos
Updates
(current)
Search
Hello World!
This is some of the website content
This is the left side
This is the center
This is the right side


- The admin tab lets you edit and create new courses
- Students can follow your courses to get a list of the course curriculum
- As a teacher you are able to see the average student progress in your course
- Click the Courses tab to preview your courses as a student


Weiterführende Literatur
CSS, HTML Templating
- https://www.youtube.com/watch?v=hQVTIJBZook
- http://selfhtml.org/ - html
- http://getbootstrap.com/ - bootstrap
- https://angular-ui.github.io/bootstrap/ - bootstrap UI
- http://www.sitepoint.com/bem-smacss-advice-from-developers/ - BEM CSS Convention
Packagemanagement: Grunt, Yeoman, Bower
- http://bower.io/ - Packagemanagement Frontend
- https://www.npmjs.com/ - Packagemanagement Frontend
- http://gruntjs.com/getting-started - Taskrunner
- http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/ - yeoman example for angular
Angular Best Practices von scotch.io
- https://scotch.io/tutorials/making-skinny-angularjs-controllers
- https://scotch.io/tutorials/angularjs-form-validation
- https://github.com/johnpapa/angular-styleguide
Sublime
- https://scotch.io/tag/sublime-text - <3 scotch


#include <NUC029FAE.h>
Definition at line 748 of file NUC029FAE.h.
◆ DFBADR
| __I uint32_t FMC_T::DFBADR |
DFBADR
Offset: 0x14 Data Flash Base Address Register
| Bits | Field | Descriptions |
| [31:0] | DFBA | Data Flash Base Address |
| | This register indicates data flash start address. It is a read only register. |
| | | | | |It is a read only register. | | | | | |The data flash start address is defined by user. Since on chip flash erase | | |unit is 512 bytes, it is mandatory to keep bit 8-0 as "0".
Definition at line 881 of file NUC029FAE.h.
◆ ISPADR
| __IO uint32_t FMC_T::ISPADR |
ISPADR
Offset: 0x04 ISP Address Register
| Bits | Field | Descriptions |
| [31:0] | ISPADR | ISP Address |
| | NuMicro NUC029FAETM series supports word program only. ISPADR[1:0] must be kept |
| | 00b for ISP operation. |
Definition at line 817 of file NUC029FAE.h.
◆ ISPCMD
| __IO uint32_t FMC_T::ISPCMD |
ISPCMD
Offset: 0x0C ISP Command Register
| Bits | Field | Descriptions |
| [5:0] | FOEN_FCEN_FCTRL | ISP Command |
| | ISP command table is shown below: |
| | Operation Mode, FOEN, FCEN, FCTRL[3:0] |
| | Read , 0, 0, 0000 |
| | Program , 1, 0, 0001 |
| | Page Erase , 1, 0, 0010 |
| | Read CID , 0, 0, 1011 |
| | Read DID , 0, 0, 1100 |
| | Read UID , 0, 0, 0100 |
Definition at line 849 of file NUC029FAE.h.
◆ ISPCON
| __IO uint32_t FMC_T::ISPCON |
ISPCON
Offset: 0x00 ISP Control Register
| Bits | Field | Descriptions |
| [0] | ISPEN | ISP Enable |
| | ISP function enable bit. Set this bit to enable ISP function. |
| | 1 = Enable ISP function |
| | 0 = Disable ISP function |
| [1] | BS | Boot Select |
| | Set/clear this bit to select next booting from LDROM/APROM, respectively. |
| | This bit also functions as MCU booting status flag, which can be used to |
| | check where MCU booted from. This bit is initiated with the inverse value |
| | of CBS in Config0 after power-on reset; It keeps the same value at other reset. |
| | 1 = Boot from LDROM |
| | 0 = Boot from APROM |
| [4] | CFGUEN | Enable Config-bits Update by ISP |
| | 1 = Enable ISP can update config-bits |
| | 0 = Disable ISP can update config-bits. |
| [5] | LDUEN | LDROM Update Enable |
| | LDROM update enable bit. |
| | 1 = LDROM can be updated when the MCU runs in APROM. |
| | 0 = LDROM cannot be updated |
| [6] | ISPFF | ISP Fail Flag |
| | This bit is set by hardware when a triggered ISP meets any of the following conditions: |
| | (1) APROM writes to itself. |
| | (2) LDROM writes to itself. |
| | (3) CONFIG is erased/programmed when the MCU is running in APROM. |
| | (4) Destination address is illegal, such as over an available range. |
| | Write 1 to clear. |
| [7] | SWRST | Software Reset |
| | Writing 1 to this bit to start software reset. |
| | It is cleared by hardware after reset is finished. |
| [10:8] | PT | Flash Program Time |
| | 000 = 40 us |
| | 001 = 45 us |
| | 010 = 50 us |
| | 011 = 55 us |
| | 100 = 20 us |
| | 101 = 25 us |
| | 110 = 30 us |
| | 111 = 35 us |
| [14:12] | ET | Flash Erase Time |
| | 000 = 20 ms (default) |
| | 001 = 25 ms |
| | 010 = 30 ms |
| | 011 = 35 ms |
| | 100 = 3 ms |
| | 101 = 5 ms |
| | 110 = 10 ms |
| | 111 = 15 ms |
Definition at line 804 of file NUC029FAE.h.
◆ ISPDAT
| __IO uint32_t FMC_T::ISPDAT |
ISPDAT
Offset: 0x08 ISP Data Register
| Bits | Field | Descriptions |
| [31:0] | ISPDAT | ISP Data |
| | Write data to this register before ISP program operation |
| | Read data from this register after ISP read operation |
Definition at line 830 of file NUC029FAE.h.
◆ ISPTRG
| __IO uint32_t FMC_T::ISPTRG |
ISPTRG
Offset: 0x10 ISP Trigger Control Register
| Bits | Field | Descriptions |
| [0] | ISPGO | ISP start trigger |
| | Write 1 to start ISP operation and this bit will be cleared to 0 by hardware automatically when ISP |
| | operation is finish. |
| | 1 = ISP is on going |
| | 0 = ISP operation is finished. |
Definition at line 864 of file NUC029FAE.h.
The documentation for this struct was generated from the following file:
- C:/Users/yachen/workzone/bsp/nuc029faebsp/Library/Device/Nuvoton/NUC029FAE/Include/NUC029FAE.h


In this scenario, the app will update and clear badge and tile notifications on the lock screen.
Lock screen apps can display up-to-date information through badge notifications and tile updates. Badge
notifications are limited to an integer or glyph that is displayed next to a monochrome badge associated
with the app. The badge displayed on the lock screen is the same badge that is displayed on the app's Start tile.
Tile updates are sent in the same manner as updates sent to the tile on the Start screen, but are limited to text
only and must be wide templates. The most recent wide tile update for the app will be displayed on the lock screen.
If an image-only template or the default tile is set, then nothing will appear for the app in the detailed status
slot on the lock screen. Users must manually select which app may show tile notifications on the lock screen.
Please see the "Tiles" and "Push and Periodic Notifications" samples for more information on how an app can display
update tile notifications.
Above, the NotificationsExtensions library is used to create notifications. You can also create notifications with strings:


The Intergovernmental Panel on Climate Change (IPCC) is the United Nations body for assessing the science related to climate change. It provides regular assessments of the scientific basis of climate change, its impacts and future risks, and options for adaptation and mitigation.
One of their recent assessments, the "Global Warming of 1.5 °C" report, provides numbers defining the world's global CO2 emission budget. This budget represents the amount of CO2 emissions the world is allowed to emit in order to limit the global temperature rise to 1.5 °C above pre-industrial levels. For a two-thirds chance of limiting warming to 1.5°C, this budget is 420 GtCO2. For a fifty-fifty chance of limiting warming to 1.5 °C the available budget is around 580 GtCO2.
The budget is calculated for the start of 2018.
The tons/sec as shown in the clock are calculated from the anual CO2 emissions of 2017.
“One of the key messages that comes out very strongly from this report is that we are already seeing the consequences of 1°C of global warming through more extreme weather, rising sea levels and diminishing Arctic sea ice, among other changes,” said Panmao Zhai, Co-Chair of IPCC Working Group I.
The Paris Agreement aims to limit global warming to 2°C, 0.5°C more than mentioned in the IPCC report. Some scenarios comparing the impact of a 1.5°C and a 2°C increase:
A complete list of impacts when missing the 1.5 °C goal from the IPCC report: Summary for Policymakers
Extinction Rebellion is an international movement that uses non-violent civil disobedience in an attempt to halt mass extinction and minimise the risk of social collapse.
|
Country
▼
▲
|
Total Budget [tons]
▼
▲
|
% of World Budget
▼
▲
|
Budget Left [tons]
▼
▲
|
|---|


Apple considers bundling all digital subscriptions in one
NEW YORK, Nov 15 — Apple's internet subscription services could be available as a bundle in 2020.
Bloomberg reported yesterday, citing “people familiar with the matter,” that Apple is considering offering all its digital services — News+, TV+, and Music — as a bundle as early as next year.
This move would be an attempt to draw in more subscribers during a time when smartphone sales are beginning to plateau; however, it could leave News+ publishers out to dry. While Apple already keeps half of the monthly subscription cost and gives the rest to respective publishers, making News+ part of a bundle would reduce publishers' revenue even further.
Already, publishers have expressed dissatisfaction about the amount of money they've received; whether it's the result of Apple having few subscribers or the company taking half of the revenue is yet to be determined. The service recently expanded to Australia and the UK, so numbers could potentially increase.
Likewise, advertisers have expressed frustration with News+ because of Apple's data privacy practices.
Despite these issues, some media are confident enough in Apple's News+ performance to support a transition towards bundling. The offering could be available in 2020. — AFP-Relaxnews


Red Sauce, Spicy Italian Sausage, Green Peppers, Crushed Garlic
$15/18
White Garlic Sauce, Spinach, Roasted Feta, Carmelized Onions,
and a light dusting of Herbs and Spices.
$15/18
Red Sauce, Aged Pepperoni, Local Mushrooms, Crushed Garlic,
Jalepeños, and Sundried Tomatoes.
$15/18
Pesto Sauce, Smoked Mushrooms, Fresh Mozzerella, Basil, Olive Oil
$15/18
White Garlic Sauce, Jalepeños, Chorizo, Pepperoni, Green Peppers.
$15/18
Canadian Bacon, House Sausage, Spinach, Smoked Mushrooms
$15/18


Servo Debug Console
Warning
. Please correct your input.
.
. Completed successfully.
Servo Host
App ID and Key
You client identifier string, can be anything.
Your key for signing the authentication token.
Authentication
Enable Authenicated Mode
Servo supports anonymous unsigned tokens and client signed tokens with shared per client unique key. This key is used to sign tokens in order to be accepted by Servo.
HS256
HS384
HS512
Signature algorithm.
Key
Unique URL-encoded item path.
Method and Type
GET
POST
PUT
DELETE
Plain text
JSON
Multipart
Base64
Item content type.
Item Content
Payload to be sent to Servo
Contents of the response from servo
Send
Reset


PyPairs - A python scRNA-Seq classifier¶
This is a python-reimplementation of the Pairs algorithm as described by A. Scialdone et. al. (2015). Original Paper available under: <https://doi.org/10.1016/j.ymeth.2015.06.021>
A supervided maschine learning algorithm aiming to classify single cells based on their transcriptomic signal. Initially created to predict cell cycle phase from scRNA-Seq data, this algorithm can be used for various applications.
Build to be fully compatible with Scanpy [Wolf18].
Code available on GitHub.
Authors¶
- Antonio Scialdone - original algorithm
- Ron Fechtner - implementation and extension in Python


regcore.db package
Submodules
regcore.db.django_models module
Each of the data structures relevant to the API (regulations, notices,
etc.), implemented using django models
-
class regcore.db.django_models.DMDiffs[source]
Bases: object
Implementation of Django-models as diff backend
-
get(label, old_version, new_version)[source]
Find the associated diff
-
put(label, old_version, new_version, diff)[source]
Store a diff between two versions of a regulation node
-
class regcore.db.django_models.DMLayers[source]
Bases: object
Implementation of Django-models as layers backend
-
bulk_put(layers, version, layer_name, root_label)[source]
Store all layer objects
-
get(name, label, version)[source]
Find the layer that matches these parameters
-
class regcore.db.django_models.DMNotices[source]
Bases: object
Implementation of Django-models as notice backend
-
get(doc_number)[source]
Find the associated notice
-
listing(part=None)[source]
All notices or filtered by cfr_part
-
put(doc_number, notice)[source]
Store a single notice
-
class regcore.db.django_models.DMRegulations[source]
Bases: object
Implementation of Django-models as regulations backend
-
bulk_put(regs, version, root_label)[source]
Store all reg objects
-
get(label, version)[source]
Find the regulation label + version
-
listing(label)[source]
List regulation versions that match this label
regcore.db.es module
Each of the data structures relevant to the API (regulations, notices,
etc.), implemented using Elastic Search as a data store
-
class regcore.db.es.ESDiffs[source]
Bases: object
Implementation of Elastic Search as diff backend
-
get(label, old_version, new_version)[source]
Find the associated diff
-
put(label, old_version, new_version, diff)[source]
Store a diff between two versions of a regulation node
-
static to_id(label, old, new)[source]
-
class regcore.db.es.ESLayers[source]
Bases: object
Implementation of Elastic Search as layers backend
-
bulk_put(layers, version, layer_name, root_label)[source]
Store all layer objects
-
get(name, label, version)[source]
Find the layer that matches these parameters
-
class regcore.db.es.ESNotices[source]
Bases: object
Implementation of Elastic Search as notice backend
-
get(doc_number)[source]
Find the associated notice
-
listing(part=None)[source]
All notices or filtered by cfr_part
-
put(doc_number, notice)[source]
Store a single notice
-
class regcore.db.es.ESRegulations[source]
Bases: object
Implementation of Elastic Search as regulations backend
-
bulk_put(regs, version, root_label)[source]
Store all reg objects
-
get(label, version)[source]
Find the regulation label + version
-
listing(label)[source]
List regulation versions that match this label
regcore.db.splitter module
Each of the data structures relevant to the API (regulations, notices,
etc.), implemented as a ‘split’, writing content to both django and Elastic
Search, but only reading from django
-
class regcore.db.splitter.SplitterDiffs[source]
Bases: object
Implementation of django+elastic search as regulations backend
-
put(label, old_version, new_version, diff)[source]
Write to both
-
class regcore.db.splitter.SplitterLayers[source]
Bases: object
Implementation of django+elastic search as layers backend
-
bulk_put(layers, version, layer_name, root_label)[source]
Write to both
-
class regcore.db.splitter.SplitterNotices[source]
Bases: object
Implementation of django+elastic search as notices backend
-
put(doc_number, notice)[source]
Write to both
-
class regcore.db.splitter.SplitterRegulations[source]
Bases: object
Implementation of django+elastic search as regulations backend
-
bulk_put(regs, version, root_label)[source]
Write to both
Module contents
Interfaces for each of the data structures relevant to the API
(regulations, notices, etc.). When instantiating the interface, it returns
the associated backend class instead (e.g. for django, elastic search, or
the splitter backend).
-
class regcore.db.Diffs[source]
Bases: object
A level of indirection for our database abstraction. All backends
should provide the same interface.
-
get(label, old_version, new_version)[source]
Documentation method. Return matching diff or None
-
put(label, old_version, new_version, diff)[source]
Documentation method. label, old_version, new_version:String,
diff:Dict
-
class regcore.db.Layers[source]
Bases: object
A level of indirection for our database abstraction. All backends
should provide the same interface.
-
bulk_put(layers, version, layer_name, root_label)[source]
Documentation method. Add many entries, with the root of the
entries having root_label and all entries having layer_name and
version
-
get(name, label, version)[source]
Doc method. Return a single layer (no meta data) or None
-
class regcore.db.Notices[source]
Bases: object
A level of indirection for our database abstraction. All backends
should provide the same interface.
-
get(doc_number)[source]
Documentation method. Return matching notice or None
-
listing(part=None)[source]
Documentation method. Return all notices or notices by part
-
put(doc_number, notice)[source]
Documentation method. doc_number:String, notice:Dict
-
class regcore.db.Regulations[source]
Bases: object
A level of indirection for our database abstraction. All backends
should provide the same interface.
-
bulk_put(regs, version, root_label)[source]
Documentation method. Add many entries, with a root of root_label.
Each should have the provided version
-
get(label, version)[source]
Documentation method. Returns a regulation node or None
-
listing(label)[source]
Documentation method. List regulation versions that match this
label, sorted


Selene
the Moon
July 7, 1995
San Francisco, CA
On July 7, 1995, Selene was a waxing gibbous moon, and at 12:00 am she was visible in the sky over San Francisco.
She was waiting to see something special today, but she realized it was going to take a while. She decided it would be better to come back later in the day, so she set at 1:37 am and decided to go see some of her other favorite places.
By the time she got to Tokyo, Japan, it was already 1:17 pm. She hungout with the Ra, the sun, and they gushed over the delicious sushi people were eating below.
Next, she decided she wanted to see what everyone was doing in Egypt. She had already been earlier in the day, but she joined Ra there at 2:42 pm because she just loved seeing the Great Pyramids of Giza and the Great Sphinx.
Ra moved on to the next place before Selene, but next she met him in Santorini, Greece at 3:16 pm. They watched everyone lounging on the beaches under Ra's bright rays, and they also checked out the Acropolis of Athens while they were over Greece.
It was 3:37 pm when she got back to Paris, France, and she watched people having picnics in front of the Eiffel Tower.
When she got to London, England, Big Ben told her it was 3:34 pm there, which meant it was 4:34 pm in Paris and 7:30 am back in San Francisco.
She was getting worried she was going to miss the big event in San Francisco, so she made her way back to the US. It was 3:19 pm when she got to New York City, and she stayed and watched all the fascinating people walking around the city that never sleeps.
By the time she got back to San Francisco, it was 3:19 pm PST, and Ra decided he would wait around with her to see what she was so excited about.
Finall, after a long day of waiting, Selene finally got to see what she had been waiting for.
Preciselly at 7:10 pm, Selene and Ra both welcomed a new baby into the world. They both watched as she took her first breath, and they both squealed with excitement as her mother held her for the first time.