R Programming, For Beginners, Quick Start Guide. by Yao Ray
Author:Yao, Ray [Yao, Ray]
Language: eng
Format: epub
Publisher: Step by Step Tutorial eBook & Book
Published: 2020-08-05T16:00:00+00:00
unlist( )
unlist( ) can convert a list to a vector.
Example 5.18
> myList <- list(2:6) # create a list
> print(myList)
Output:
[[1]]
[1] 2 3 4 5 6
> myVector <- unlist (myList) # conversion
> print(myVector)
Output
[1] 2 3 4 5 6
Explanation:
myVector <- unlist (myList) converts a list to a vector.
Summary
In R, a value is considered to be a vector; its length is 1.
The example to create one element vector:
> print("good") # “good” is a character vector
[1] "good"
The example to create a multiple element vector:
> print(2: 8)
[1] 2 3 4 5 6 7 8
> print(c(3,4,5))
[1] 3 4 5
seq(v1, v2, by = step) can create a vector from v1 to v2.
by = step specifies the distance among each element.
[index] can access all elements of a vector, the index starts with 1.
TRUE, FALSE, 1,0 , and all numbers can work as an index.
[-index] Assigning a negative value to an index can remove the corresponding element.
When two vectors of different lengths are manipulated, shorter vectors are treated as equal lengths.
“sort( vector, decreasing=TRUE/FALSE)” sorts elements in a vector.
list(val1, val2, val3, … ) can create a list.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
API Testing and Development with Postman by Dave Westerveld(3624)
Learning C# by Developing Games with Unity 2020 by Harrison Ferrone(2619)
Software Architecture for Busy Developers by Stéphane Eyskens(2325)
2021 Beginners Guide to Python Programming Language: A Crash Course to Mastering Python in One Hour by Elmer Gary & Elmer Gary(1884)
Machine Learning for Algorithmic Trading by Stefan Jansen(1629)
Hands-On ROS for Robotics Programming by Bernardo Ronquillo Japón(1572)
Delphi GUI Programming with FireMonkey by Andrea Magni(1457)
Game Development Projects with Unreal Engine by Hammad Fozi & Goncalo Marques & David Pereira & Devin Sherry(1402)
Cloud Native with Kubernetes by Alexander Raul(1374)
Datadog Cloud Monitoring Quick Start Guide by Thomas Kurian Theakanath(1347)
Software Architecture Patterns for Serverless Systems by John Gilbert(1338)
Practical Node-RED Programming by Taiji Hagino(1336)
Automate It with Zapier by Kelly Goss(1318)
Practical System Programming for Rust Developers by Prabhu Eshwarla(1312)
Delphi Programming Projects by William Duarte(1296)
Mastering React Test-Driven Development by Daniel Irvine(1290)
Developing Multi-Platform Apps with Visual Studio Code by Ovais Mehboob Ahmed Khan & Khusro Habib & Chris Dias(1253)
Ghidra Software Reverse Engineering for Beginners by A. P. David(1245)
Learn Spring for Android Application Development by S. M. Mohi Us Sunnat(1236)
