HTML stands for HyperText Markup Language. A markup language is a way to write down information with embedded instructions that tell a computer how to interpret and display that information. HTML contains the important information for stucture of the content of a webpage, such as text, images, links and more. HTML tells the computer what you want to see, the computer can read and interpret the HTML and produce an output.
HTML is used to create websites. Every website in existance is written in HTML. In fact, this website that you are on right now was written in HTML. Whilst the primary use of HTML is websites, it is also sometimes used to create emails as well as mobile and desktop apps.
With HTML, you can make your own websites. You can build personal blogs, portfolios, or business websites, and have full control over the content and layout. HTML is also a highly sought-after skill in many job markets. With the rise of the internet, HTML is ever-so relevant to learn.
To write HTML, you need a text editor. A text editor is simply an application that allows you to write and edit text. When first starting out, it is best to use a simple text editor such as the text editors that already come preinstalled on all desktop computers:
On MacOS Open Finder > Applications > TextEdit
On WindowsOS Start > Search & Open "Notepad"
On ChromeOS Launcher > Search & Open "Text"
HTML is written in tags. Tags are basically the instructions that tell tht computer what to do. Tags are written with a less than sign (<) followed by the tag name and then a greater than sign (>). Then follows the content of the tag. After the content, the tag needs to be closed, to do this, we write a closing tag which is a repition of the opening tag with a forward slash (/) after the less than sign (<)
An example of how a tag is written:
<tag> content </tag>
Some tags don't have any content between them. When this is the case, we only write one tag, not two. However, when only writing one tag, this tag need to close itself, so we write the tag as normal but put a forward slash (/) before the greater than (<) sign
An example of how a self-closing tag is written:
<tag/>
Before writing any tags we must always include two essential tags at the very top of our document. We must write <!DOCTYPE html> just once. The <!DOCTYPE html> tag declares that the file is a HTML file, which is important for the web browser to know when processing files
The essential tag that must always be present at the top of any HTML document
<!DOCTYPE html>
We must also always include the <html> tag when writing html. We embed all of the HTML inside the <html> tag.
The two essential tags of any HTML document
<!DOCTYPE html>
<html>
All Content
</html>
HTML
<h1>Heading 1</h1>
Displayed
HTML
<h2>Heading 2</h2>
Displayed
HTML
<h3>Heading 3</h3>
Displayed
HTML
<h4>Heading 4</h4>
Displayed
HTML
<h5>Heading 5</h5>
Displayed
HTML
<h6>Heading 6</h6>
Displayed
HTML
<p>This is a paragraph</p>
Displayed
This is a paragraph
HTML
<h2><b>Text</b></h2>
Displayed
HTML
<h2><i>Text</i></h2>
Displayed
HTML
<h2><u>Text</u></h2>
Displayed
HTML
<h2><big>Text</big></h2>
Displayed
HTML
<h2><small>Text</small></h2>
Displayed
HTML
<h2><strong>Text</strong></h2>
Displayed
HTML
<h2><em>Text</em></h2>
Displayed
HTML
<h2><mark>Text</mark></h2>
Displayed
HTML
<h2><del>Text</del></h2>
Displayed
HTML
<h2><ins>Text</ins></h2>
Displayed
HTML
<h2>cm<sup>3</sup></h2>
Displayed
HTML
<h2>CO<sub>2</sub></h2>
Displayed
HTML
<h2><u><i><mark><big>Text</big></mark></i></u></h2>
Displayed
HTML
<!DOCTYPE html>
<html>
<p>Paragraph 1</p>
<br/>
<p>Paragraph 2</>
</html>
Displayed
Paragraph 1
Paragraph 2
HTML
<!DOCTYPE html>
<html>
<p>Paragraph 1</p>
<hr/>
<p>Paragraph 2</>
</html>
Displayed
Paragraph 1
Paragraph 2
HTML
<!DOCTYPE html>
<html>
<pre>Paragraph 1
Paragraph 2</pre>
</html>
Displayed
Paragraph 1
Paragraph 2
HTML
<img src="https://i.imgur.com/xCPZT2V.jpg" alt="The Arc De Triomphe Monument in Paris" width="50%" height="50%">
Displayed
HTML
<audio src="xyzzzpoemchargeofthelightbrigade.mp3" controls></audio>
Displayed
HTML
<video src="https://i.imgur.com/dlEu1yM.mp4" controls></video>
Displayed
HTML
<ol>
<li>Pizza</li>
<li>Pasta</li>
<li>Ice Cream</li>
</ol>
Displayed
And here is an unodered HTML list:
HTML
<ul>
<li>Pizza</li>
<li>Pasta</li>
<li>Ice Cream</li>
</ul>
Displayed
Tables can be created in HTML using the <table> tag. Inside of the table tag we use the <tr> tag to define a row in a table. Inside of the <tr> tag we use the <th> to define the headers of the table, or we use the <td> tag to define the cells of the table.
HTML
<table>
<tr>
<th>Name</th>
<th>Surname</th>
<th>Age<th>
</tr>
<tr>
<td>John</th>
<td>Doe</th>
<td>69<th>
</tr>
<tr>
<td>Jane</th>
<td>Doe</th>
<td>6900<th>
</tr>
</table>
Displayed
Name | Surname | Age |
---|---|---|
John | Doe | 69 |
Jane | Doe | 6900 |
HTML
<center><h4>Centered Text</h4></center>
Displayed
HTML
<button>Click Me</button>
Displayed
HTML
<a href="https://photography.samfield.org" target="_blank"><button>Click Me</button></a>
HTML
<form>
<label for="message">Write Message</label><br/>
<input id="message" type="text">
</form>
Displayed
HTML
<!doctype HTML>
<html>
<head>
Invisible metadata
</head>
<body>
All visible webpage content
</body>
</html>
Result
HTML
<head>
<title>Sam Studies</title>
</head>
Result
"Sam Studies" is displayed in the browser tab.
HTML
<head>
<link rel="stylesheet" href="style.css">
</head>
Result
The file: style.css is accessible by the current file.
HTML
<head>
<link rel="icon" href="https://i.imgur.com/vOcNiq9.png">
</head>
Result
Sam Studies logo displayed in the browser tab.
HTML
<head>
<meta charset="UTF-8">
</head>
Result
The webpage will contain characters from the UTF-8 character set.
HTML
<head>
<meta name="keywords" content="Study, GCSE, Revision">
</head>
Result
The webpage will contain the keywords: "Study", "GCSE" & "Revision".
HTML
<head>
<meta name="description" content="A website for GCSE study resources">
</head>
Result
The webpage will contain the description: "A website for GCSE study resources".
HTML
<head>
<meta name="author" content="Sam Field">
</head>
Result
Sam Field is the author of this webpage.
HTML
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
Result
Viewport set to device width and standard zoom.
HTML
<head>
<meta http-equiv="refresh" content="60">
</head>
Result
Page will be reloaded every 60 seconds.
HTML
<head>
<meta http-equiv="refresh" content="60; url ="https://instagram.com/sams.photo.gallery">
</head>
Result
After 60 seconds, page will redirect to https://instagram.com/sams.photo.gallery
HTML
<html lang="en">
</html>
Result
Language set to English
HTML
<html lang="en-GB">
</html>
Result
Language set to English. Country set to United Kingdom.
& Ampersand &&
" Double Quatation Mark ""
' Apostrophe ''
¢ Cent ¢¢
£ Pound ££
¥ Yen ¥¥
€ Euro €€
© Copyright ©©
® Registered ®®
™ Trademark ™™
- Minus −
+ Plus +
× Multiply ×
÷ Divide ÷
= Equal =
≠ Not Equal ≠
≈ Approximately Equal ≈
< Less Than <
≤ Less Than or Equal ≤
> Greater Than >
≥ Greater Than or Equal ≥
± Plus or Minus ±
∝ Proportional ∝
∑ Summation ∑
∏ Product ∏
⌊ Left Floor Parenthesis ⌊
⌋ Right Floor Parenthesis ⌋
⌈ Left Ceiling Parenthesis ⌈
⌉ Right Ceiling Parenthesis ⌉
CSS stands for Cascading Style Sheet. A style sheet is a document that defines the presentation and formatting of a structured document. Style sheets specify how elements should be displayed on the screen. CSS is used to style an HTML document. CSS allows us to change the colour, font, size, layout and so much more of an HTML document.
CSS is used to style HTML documents therefore CSS is responsible for the design of a website.
With CSS, you can enhance your own websites. You can have full control over the content and layout. CSS is also a highly sought-after skill in many job markets. With the rise of the internet, CSS is ever-so relevant to learn..
To write CSS, you need a text editor. A text editor is simply an application that allows you to write and edit text. When first starting out, it is best to use a simple text editor such as the text editors that already come preinstalled on all desktop computers:
On MacOS Open Finder > Applications > TextEdit
On WindowsOS Start > Search & Open "Notepad"
On ChromeOS Launcher > Search & Open "Text"
HTML
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
</html>
Displayed
HTML
<!DOCTYPE html>
<html>
<style>
CSS goes here
</style>
</html>
Displayed
HTML
<!DOCTYPE html>
<html>
<h style="CSS goes here"><h>
</html>
Displayed
HTML
<h3 style="color: green;">This text is green</h3>
Displayed
HTML
<h3 style="background-color: pink;">This text is green</h3>
Displayed
HTML
<h3 style="background-color: purple; color: white;">This text is white with a purple background</h3>
Displayed
HTML
<h3 style="background-color: purple; color: white; display: inline;">This text is white with a purple background</h3>
Displayed
HTML
<h3 style="font-size: 20px;">Text</h3>
Displayed
HTML
<h3 style="font-size: 20%;">Text</h3>
Displayed
HTML
<h3 style="font-size: 20vw;">Text</h3>
Displayed
HTML
<h3 style="border: 2px solid black">A solid border</h3>
Displayed
HTML
<h3 style="border: 2px dashed black">A dashed border</h3>
Displayed
HTML
<h3 style="border: 2px dotted black">A dotted border</h3>
Displayed
JavaScript is a programming language used to create interactive and dynamic content on webpages.
JavaScript is primarily used in Web Development but is also used in Game Development, Mobile and Desktop applications, and Server-Side Development.
With JavaScript, you can enhance your own websites. .
To write JavaScript, you need a text editor. A text editor is simply an application that allows you to write and edit text. When first starting out, it is best to use a simple text editor such as the text editors that already come preinstalled on all desktop computers:
On MacOS Open Finder > Applications > TextEdit
On WindowsOS Start > Search & Open "Notepad"
On ChromeOS Launcher > Search & Open "Text"
HTML
<p id="mytext"></p>
<script>document.getElementById("mytext").innerHTML = "Hello World!";</script>
Displayed
Hello World!
MathML stands for Mathematical Markup Language. A markup language is a way to write down information with embedded instructions that tell a computer how to interpret and display that information. MathML is like a special language that computers use to write and show math problems, equations, expressions, shapes and more. MathML is the way the computer understands what we want to see, so it can show the math problems correctly on the screen.
MathMl is most commonly used to display mathematical information on websites. MathMl is also used in mobile and desktop applications and E-books.
MathML allows you to represent mathematical formulas and equations accurately on web pages and digital documents. This is especially useful for webdevelopers, educators, researchers, and anyone involved in publishing mathematical content online. As more educational and professional content moves online, the ability to create and manage mathematical content using MathML will become increasingly important.
To write MathML, you need a text editor. A text editor is simply an application that allows you to write and edit text. When first starting out, it is best to use a simple text editor such as the text editors that already come preinstalled on all desktop computers:
On MacOS Open Finder > Applications > TextEdit
On WindowsOS Start > Search & Open "Notepad"
On ChromeOS Launcher > Search & Open "Text"
MathML is written in tags. Tags are basically the instructions that tell tht computer what to do. Tags are written with a less than sign (<) followed by the tag name and then a greater than sign (>). Then follows the content of the tag. After the content, the tag needs to be closed, to do this, we write a closing tag which is a repition of the opening tag with a forward slash (/) after the less than sign (<)
Before writing any tags we must always include the essential <math> tag to encapsulate all of our MathMl inside of. The <math> tag can be put inside of a HTML Document.
HTML
<!DOCTYPE html>
<html>
<math>
All MathML content
</math>
</html>
Displayed
MathML
<math>
<mi>476</mi>
</math>
Displayed
- Minus −
+ Plus +
× Multiply ×
÷ Divide ÷
= Equal =
≠ Not Equal ≠
≈ Approximately Equal ≈
< Less Than <
≤ Less Than or Equal ≤
> Greater Than >
≥ Greater Than or Equal ≥
± Plus or Minus ±
∝ Proportional ∝
∑ Summation ∑
∏ Product ∏
⌊ Left Floor Parenthesis ⌊
⌋ Right Floor Parenthesis ⌋
⌈ Left Ceiling Parenthesis ⌈
⌉ Right Ceiling Parenthesis ⌉
So, if we want to write a multiplication sign, we would write:
MathML
<math>
<mo>×</mo>
</math>
Displayed
MathML
<math>
<mrow>
<mi>4/<mi><mo>+</mo><mi>3</mi><mo>=</mo><mi>7</mi>
</mrow>
</math>
Displayed
To write fractions, we must use the <mfrac> tag. Inside the <mfrac> tag, we must write the numerator and denominator tags, these are both written using the <mn> tag.
Let's write 0.5 in MathML.
MathML
<math>
<mrow>
<mfrac><mn>1</mn><mn>2</mn></mfrac>
</mrow>
</math>
Displayed
To write indices, we use the <msup> tag around the entire number and the <mn> tag around just the power.
MathML
<math>
<mrow>
<msup><mi>2</mi><mn>3</mn></msup>
</mrow>
</math>
Displayed
MathML
<math>
<mrow>
<mroot><mi>69</mi><mn>3</mn></mroot>
</mrow>
</math>
Displayed
MathML
<math>
<mrow>
<mi>x</mi><mo>=</mo><mfrac><mrow><mrow><mo>−</mo><mi>b</mi></mrow><mo>±</mo><mroot><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>−</mo><mrow><mn>4</mn><mo>⁢</mo><mi>a</mi><mo>⁢</mo><mi>c</mi></mrow></mrow><mn>2</mn></mroot></mrow><mrow><mn>2</mn><mo>⁢</mo><mi>a</mi></mrow></mfrac>
</mrow>
</math>
Displayed
Lilypond is a text based language used to write sheet music on a computer.
Lilypond is used to write sheet music on a computer.
Lilypond is great for beginners as it has an easy to read syntax. It is very useful for writing music on a computer. Lilypond can even be embedded into HTML documents, making it a great choice for those interested in web development.
To write Lilypond, you can either use a web based IDE (such as www.hacklily.org/ open_in_new) or you can use a local text editor. A text editor is simply an application that allows you to write and edit text. When first starting out, it is best to use a simple text editor such as the text editors that already come preinstalled on all desktop computers:
On MacOS Open Finder > Applications > TextEdit
On WindowsOS Start > Search & Open "Notepad"
On ChromeOS Launcher > Search & Open "Text"
NOTE: IF USING A LOCAL TEXT EDITOR YOU WILL NEED TO INSTALL LILYPOND FROM https://lilypond.org/open_in_new
Lilypond
\language "english"
Displayed
Lilypond
\clef bass
Displayed
Lilypond
\numericTimeSignature
\time 4/4
Displayed
Lilypond
\key a \minor
Displayed
Lilypond
\relative c'
Displayed
Lilypond
\relative c' {\clef treble \numericTimeSignature \Time 4/4 c d e f}
Displayed
Lilypond
\relative c' {\clef treble \numericTimeSignature \Time 4/4 1c 2d 3e 4f 8g 16a 32b}
Displayed
Lilypond
\relative c' {\clef treble \numericTimeSignature \Time 4/4 1c 2d 3e 4f 8g 16a 32b}
Displayed
Python is a general purpose programming language. We use python to give instructions to computers.
Python is used in web development, software development, mathematics, system scripting and more.
Python is great for beginners as it has an easy to read syntax. It is also a very popular language and is used in many fields. Python can even be embedded into HTML documents, making it a great choice for those interested in web development.
To write Python, you can either use a web based IDE (such as Replit.com open_in_new) or you can use a local text editor. A text editor is simply an application that allows you to write and edit text. When first starting out, it is best to use a simple text editor such as the text editors that already come preinstalled on all desktop computers:
On MacOS Open Finder > Applications > TextEdit
On WindowsOS Start > Search & Open "Notepad"
On ChromeOS Launcher > Search & Open "Text"
NOTE: IF USING A LOCAL TEXT EDITOR YOU MAY NEED TO INSTALL PYTHON FROM python.orgopen_in_new
HTML
<!DOCTYPE html>
<html>
<head>
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<py-script>
</py-script>
</html>
Displayed
python
print("Hello World!")
Displayed
Hello World!
python
name = "John"
print(name)
Displayed
John
NOTE: SOME COMPILERS REQUIRE YOU TO HAVE AT LEAST A TWO LINE GAP BETWEEN THE VARIABLE AND PRINT
Now let's create multiple variables and print them in different ways
python
name = "John"
surname = " Doe"
age = 69
wife = "Jane"
wife_surname = " Doe"
wife_age = 6900
print(name+surname)
Displayed
John Doe
python
print(age+wife_age)
Displayed
6969
python
print(name+surname, wife+wife_surname)
Displayed
John Doe
Jane Doe
Python allows us to perform basic mathematical calculations.
python
print(2+5)
Displayed
7
python
print(2-5)
Displayed
-3
python
print(2*5)
Displayed
10
python
print(2/5)
Displayed
0.4
**
.
python
print(4 ** 2)
Displayed
16
python
print(9 // 2)
Displayed
4
import math
python
import math
Displayed
math.sqrt()
to square root a number.python
import math
print(math.sqrt(25))
Displayed
5
math.ceil()
will round a number up to its nearest whole number, and math.floor()
will round a number down to its nearest whole number.python
import math
print(math.ceil(1.7))
Displayed
2
python
import math
print(math.floor(1.7))
Displayed
1
math.pi
function to do this.python
import math
print(math.pi)
Displayed
3.141592653589793
math.sin()
, math.cos()
or math.tan()
python
import math
print(math.sin(90))
Displayed
0.8939966636005579
math.radians()
function to convert our degrees to radians.python
import math
print(math.sin(math.radians(90)))
Displayed
1
python
5 == 5
Displayed
True
python
9 == 5
Displayed
False
python
9 > 5
Displayed
True
python
9 != 5
Displayed
True
python
if name == "John":
print("Hello John")
else:
print("I don't know you")
Displayed
Hello John
Now let's see what happens when the opposite is true.
python
if name != "John":
print("Hello John")
else:
print("I don't know you")
Displayed
I don't know you
R is a programming language used for creating graphs and statistical computing.
R is most commonly used to visualise and analyse data.
R is the most popular programming language in the field of data science.
To write R, you need to first download it from https://cloud.r-project.org/index.html open_in_new
To print things in R, we literally just write them
R
Hello World!
Displayed
Hello World!
You can however, if you should want to, print things using: print("")
R
print("Hello World!")
Displayed
Hello World!
R allows us to perform mathematical calculations.
R
2+5
Displayed
7
R
2-5
Displayed
-3
R
2*5
Displayed
10
R
2/5
Displayed
0.4
The sqrt() function returns the square root of a number:
R
sqrt(25)
Displayed
5
The abs() function returns the absolute (positive) value of a number:
R
abs(-25)
Displayed
25
The ceiling() function rounds a number upwards to its nearest whole number, and the floor() function rounds a number downwards to its nearest whole number:
R
ceiling(1.69)
Displayed
2
R
floor(1.69)
Displayed
1
A variable is a name that stores a value. Variables are useful because instead of remembering everything, we can just remember the name of the variable. We can assign a value to a variable using the code: variable_name <- value.
R
name <- "John"
name
Displayed
John
Now let's create multiple variables and print them in different ways. To print multiple variables at once, we use the paste(variable1, variable2) function.
R
name <- "John"
surname <- "Doe"
age <- "69"
wife_name <- "Jane"
wife_surname <- "Doe"
wife_age <- "6900"
paste(name, surname)
Displayed
John Doe
R
age + wife_age
Displayed
6969
R
paste("Hello", name)
Displayed
Hello, John
R
5 == 5
Displayed
True
R
9 == 5
Displayed
False
R
9 > 5
Displayed
True
R
9 != 5
Displayed
True
We can write conditional statements to output different things depending on the value of a variable. We use the if statement to check if a value is true or false.
R
name <- "John"
if (name == "John") {
print("Hello, John")
}
Displayed
Hello, John
We can use the else statement to output something when the if statement is returned as false.
R
name <- "Jane"
if (name == "John") {
print("Hello, John")
} else {
print("I don't know you")
}
Displayed
I don't know you
We can use an elseif statement have mutliple possibilities of differnet "if" outputs.
R
name <- "Jane"
if (name == "John") {
print("Hello, John")
} else if (name == "Jane") {
print("Hello, Jane")
} else {
print("I don't know you")
}
Displayed
Hello, Jane
R
name <- "John"
if (name == "John") {
print("Hello, John")
} else if (name == "Jane") {
print("Hello, Jane")
} else {
print("I don't know you")
}
Displayed
Hello, John
R
name <- "Sam"
if (name == "John") {
print("Hello, John")
} else if (name == "Jane") {
print("Hello, Jane")
} else {
print("I don't know you")
}
Displayed
I don't know you
We can nest ifs inside of other ifs which allows you to test multiple criteria and increases the number of possible outcomes
R
score <- "69"
if (score > 30) {
print("Your score is above 30")
if (score > 50) {
print("and also above 50!")
} else {
print("but not above 50.")
}
} else {
print("Your score is below 30.")
}
Displayed
Your score is above 30
and also above 50!
And/Or Logical Statements
plot()
function. Inside of the brackets, we enter our coordinates, separated by a comma. First, we enter the x-coordinates, then the y-coordinates.bitmap(file="out.png")
to actually show the code in some compilers.R
plot(1, 2)
Displayed
plot()
function.R
plot(c(1, 2), c(3,4))
Displayed
R
plot(c(1, 2, 5 , 6), c(3, 4, 7, 8))
Displayed
R
xaxis <- c(1, 3, 4, 8, 13)
yaxis <- c(2, 1, 7, 9, 11)
plot(xaxis, yaxis)
Displayed
:
operator, inside of the plot()
function. The value of the smallest point goes to the left of the :
operator, and the value of the largest point goes to the right of the :
operator.R
plot(1:69)
Displayed
main=""
for the title; xlab=""
for the x-axis; and ylab=""
for the y-axis. R
plot(c(1, 2, 5 , 6), c(3, 4, 7, 8), type="l", main="My Graph", xlab="My X-axis", ylab="My Y-axis")
Displayed
col="n"
. R
plot(1:69, col="pink")
Displayed
cex=n
. We set the cex value equal to a number. 1 is the default size, 2 is 100% of the default size, and 0.5 is 50% of the default size.R
plot(1:69, col="pink", cex=2)
Displayed
pch=n
. The number equal to pch represents a shape.
0 = WHITE SQUARE□
1 = WHITE CIRCLE○
2 = WHITE UP-POINTING TRIANGLE△
3 = LIGHT VERTICAL AND HORIZONTAL┼
4 = LIGHT DIAGONAL CROSS╳
5 = WHITE DIAMOND◇
6 = WHITE DOWN-POINTING TRIANGLE▽
7 = SQUARED TIMES⊠
8 = EIGHT SPOKED ASTERISK✳
9 = DIAMOND TIMES
10 = CIRCLE PLUS⊕
11 = STAR OF DAVID✡
12 = SQUARE PLUS⊞
13 = CIRCLE WITH SUPERIMPOSED X⦻
14 = APL FUNCIONAL SYMBOL QUAD UP CARET⍓
15 = BLACK SQUARE■
16 = BLACK CIRCLE●
17 = BLACK TRIANGLE▲
18 = BLACK DIAMOND◆
19 = BLACK CIRCLE●
20 = Z NOTATION SPOT⦁
21 = LARGE BLACK CIRCLE⬤
22 = BLACK SQUARE■
23 = BLACK DIAMOND◆
24 = BLACK UP-POINTING TRIANGLE▲
25 = BLACK DOWN-POINTING TRIANLGE▼
R
plot(1:69, col="pink", cex=2, pch=8)
Displayed
type
inside of the plot()
function, and set it equal to l
.R
plot(c(1, 2, 5 , 6), c(3, 4, 7, 8), type="l")
Displayed
lwd=n
inside of the plot()
function. 1 is the default size, 2 is 100% of the default size, and 0.5 is 50% of the default size. R
plot(c(1, 2, 5 , 6), c(3, 4, 7, 8), type="l", lwd=2)
Displayed
lty=n
inside of the plot()
function. R
plot(c(1, 2, 5 , 6), c(3, 4, 7, 8), type="l", lwd=2, lty=4)
Displayed
plot()
function for one line. The other lines are plotted by placing vectors inside of the lines()
function.R
plot(c(1, 3, 4, 8, 13), c(2, 1, 7, 9, 11), type="l")
lines(c(2, 1, 7, 9, 11), c(1, 3, 4, 8, 13), type="l")
Displayed
col=""
attribute.R
plot(c(1, 3, 4, 8, 13), c(2, 1, 7, 9, 11), type="l", col="red")
lines(c(2, 1, 7, 9, 11), c(1, 3, 4, 8, 13), type="l", col="blue")
Displayed
lines()
function for as many lines as you require:R
plot(c(1, 3, 4, 8, 13), c(2, 1, 7, 9, 11), type="l", col="red")
lines(c(2, 1, 7, 9, 11), c(1, 3, 4, 8, 13), type="l", col="blue")
lines(c(1, 1, 6, 8, 12), c(1, 2, 5, 8, 13), type="l", col="orange")
lines(c(1, 3, 4, 5, 12), ,c(1, 2, 2, 3, 7), type="l", col="darkgreen")
Displayed
pie()
function. Inside the brackets, we use vector values to create the sections of the pie chart. For the sake of simplicity, these sections could be a percentage out of 100, 100 being the whole pie. R decides the size of each section by calculating the value of the section divided by the sum of all section values.R
pie(c(20, 35, 12, 4, 29))
Displayed
init.angle = n
. n is specified in degrees. The default angle is 0, we can see it as the flat horizontal line that spans from the centre of the pie, outwards to the right. R
pie(c(20, 35, 12, 4, 29), init.angle = 90)
Displayed
pie()
function. The labels are displayed in the order of the sections they will be asigned to. We can also add a title to the chart using the main=""
attribute.R
pie(c(20, 35, 12, 4, 29), init.angle = 90, c("Instagram", "Facebook", "X", "Tiktok", "Youtube"), main="Social Media Sites")
Displayed
col =
attribute inside of the pie()
function. The colours are displayed in the order of the sections they will be asigned to.R
pie(c(20, 35, 12, 4, 29), init.angle = 90, c("Instagram", "Facebook", "X", "Tiktok", "Youtube"), main="Social Media Sites", col=c("#e1306c", "#1877F2", "black", "#00f2ea", "#FF0000"))
Displayed
legend()
function. Inside of the legend()
function, we add its postion, labels and colour values. R
pie(c(20, 35, 12, 4, 29), init.angle = 90, c("Instagram", "Facebook", "X", "Tiktok", "Youtube"), main="Social Media Sites", col=c("#e1306c", "#1877F2", "black", "#00f2ea", "#FF0000"))
legend("topright", c("Instagram", "Facebook", "X", "Tiktok", "Youtube"), fill = c("#e1306c", "#1877F2", "black", "#00f2ea", "#FF0000"))
Displayed
Arduino programming language is used to write software for Arduino boards, which are microcontroller-based development platforms used for building digital devices and interactive objects.
Arduino is used to program electronics.
Arduino allows you harness the power of electricity to controll physical real-world things.
To write Arduino, you need to first download it from https://www.arduino.cc/en/main/software. open_in_new
Once installed, you can open the Arduino IDE by clicking on the Arduino icon on the desktop. You cen then write your Arduino code in the Arduino IDE.
Arduino
// This is a comment.
Output
Minecraft commands are used in the video game: Minecraft
To write Minecraft Commands, you need to first download minecraft from minecraft.net. open_in_new
Once installed, you can open the Minecraft launcher by clicking on the Minecraft icon on the desktop. You can then choose to launch Minecraft Java Edition - this will open up a new app. With Minecraft Java open, click "New World", then adjust the settings of this world to enable cheats and commands. Then click "Create World". Once the world load, press the forward slash (/) to open the chat bar. You can write your commands in here.