Write a R program to create a vector and find the length and the dimension of the vector

  • برمجة R

Write a R program to create a vector and find the length and the dimension of the vector.

الأجوبة

v = c(1,3,5,7,9)
print("Original vectors:")
print(v)
print("Dimension of the vector:")
print(dim(v))
print("length of the vector:")
print(length(v))

Sample Output:

[1] "Original vectors:"
[1] 1 3 5 7 9
[1] "Dimension of the vector:"
NULL
[1] "length of the vector:"
[1] 5
هل كان المحتوى مفيد؟

معلومات ذات صلة

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...