w3resource

R Programming: Get the details of the objects in memory

R Programming: Basic Exercise-2 with Solution

Write a R program to get the details of the objects in memory.

Sample Solution :

R Programming Code :

name = "Python"; 
n1 =  10; 
n2 =  0.5
nums = c(10, 20, 30, 40, 50, 60)
print(ls())
print("Details of the objects in memory:")
print(ls.str())

Sample Output:

[1] "n1"   "n2"   "name" "nums"
[1] "Details of the objects in memory:"
n1 :  num 10
n2 :  num 0.5
name :  chr "Python"
nums :  num [1:6] 10 20 30 40 50 60                         

R Programming Code Editor:



Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a R program to take input from the user (name and age) and display the values. Also print the version of R installation.
Next: Write a R program to create a sequence of numbers from 20 to 50 and find the mean of numbers from 20 to 60 and sum of numbers from 51 to 91.

Test your Programming skills with w3resource's quiz.

What is the difficulty level of this exercise?



Follow us on Facebook and Twitter for latest update.