Write a R program to create three vectors numeric data, character data and logical data. Display the content of the vectors and their type

  • برمجة R

Write a R program to create three vectors numeric data, character data and logical data. Display the content of the vectors and their type.

الأجوبة

a = c(1, 2, 5, 3, 4, 0, -1, -3)
b = c("Red", "Green", "White")
c = c(TRUE, TRUE, TRUE, FALSE, TRUE, FALSE)
print(a)
print(typeof(a))
print(b)
print(typeof(b))
print(c)
print(typeof(c))

Sample Output:

[1]  1  2  5  3  4  0 -1 -3
[1] "double"
[1] "Red"   "Green" "White"
[1] "character"
[1]  TRUE  TRUE  TRUE FALSE  TRUE FALSE
[1] "logical"
هل كان المحتوى مفيد؟

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

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

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