list1 = list(g1 = 1:10, g2 = "R Programming", g3 = "HTML")
print("Original list:")
print(list1)
names(list1) = c("one", "two", "three")
print("Assign new names 'one', 'two' and 'three' to the elements of the said list")
print(list1)
Sample Output:
[1] "Original list:"
$g1
[1] 1 2 3 4 5 6 7 8 9 10
$g2
[1] "R Programming"
$g3
[1] "HTML"
[1] "Assign new names 'one', 'two' and 'three' to the elements of the said list"
$one
[1] 1 2 3 4 5 6 7 8 9 10
$two
[1] "R Programming"
$three
[1] "HTML"
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer