R Programming: Create a list of heterogeneous data, which include character, numeric and logical vectors
R Programming: Basic Exercise-24 with Solution
Write a R program to create a list of heterogeneous data, which include character, numeric and logical vectors. Print the lists.
Sample Solution :
R Programming Code :
my_list = list(Chr="Python", nums = 1:15, flag=TRUE)
print(my_list)
Sample Output:
$Chr [1] "Python" $nums [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 $flag [1] TRUE
R Programming Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a R program to compute sum, mean and product of a given vector elements.
Next: Write a R program to create a Dataframes which contain details of 5 employees and display the details.
Test your Programming skills with w3resource's quiz.
What is the difficulty level of this exercise?
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework