-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsortVector.r
More file actions
25 lines (19 loc) · 799 Bytes
/
sortVector.r
File metadata and controls
25 lines (19 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#Sort a Vector
> x
[1] 7 1 8 3 2 6 5 2 2 4
> # sort in ascending order
> sort(x)
[1] 1 2 2 2 3 4 5 6 7 8
> # sort in descending order
> sort(x, decreasing=TRUE)
[1] 8 7 6 5 4 3 2 2 2 1
> # vector x remains unaffected
> x
[1] 7 1 8 3 2 6 5 2 2 4
# 👋 Hi, I’m @aarushinair - Aarushi Nair (she/her/ella)
# 👀 I’m a Computer Science Engineering Student
# 💞️ I’m looking to collaborate on #java, #python, #R, #applicationdevelopment
# 🌱 #GirlsWhoCode #WomenInTech #WomenInIT #WomenInSTEM #CyberSecurity #QuantumComputing #BlockChain #AI #ML
# 📫 How to reach me: https://www.linkedin.com/in/aarushinair/
# 👩🏫 YouTube Channel - Code with Aarushi : https://www.youtube.com/channel/UCKj5T1ELHCmkGKujkpqtl7Q
# 🙋 Follow me on Twitter: https://twitter.com/aarushinair_