Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
At matrix division
#R version 3.4.4 print("Hello, world!") print("Praveen k Yadav 2277") print("PRACTICAL 1:- R as a calculator") help(log) log(10) log(Inf,base=2) log(1,base=exp(1)) help(sqrt) sqrt(125) sqrt(25)+sqrt(225)+sqrt(3^2+4^2) sin(pi/2) (sin(pi/2))^2+(cos(pi/3))^2 a=2^3 b=2*a a+b a=4 b=2*a^2+3*a-5 b c=2*a+3*b^2-2*b c ls() rm(a,b,c) ls() a=c(2,3,4,5,12) calc1=1+5 calc1 class(calc1) calc2=1.5+2.3 calc2 class(calc2) numbers1=c(1,2,5) numbers1 class(numbers1) numbers2=1:20 numbers2 class(numbers2) Char1="Hello world" Char1 class(Char1) Char2="VECTOR TYPE" Char2 vector1=vector (mode='logical',3) vector1 vector2=vector(mode='logical',5) vector2 vector2[3]=TRUE vector2 [4]=TRUE vector2 [5]=TRUE vector2 class(vector2) Char3="MATRIX DATA TYPES" Char3 matrix1=matrix(1:9,nrow=3) matrix1 matrix2=matrix(1:10,nrow=4) matrix2 matrix3=matrix(1:8,nrow=4) matrix3 matrix4=matrix(1:13,nrow=4) matrix4 matrix5=matrix(1:13,ncol=3) matrix5 matrix6=matrix(c(2,5,7,1,4,6,9,0,3,1),ncol=3) matrix6 matrix7=matrix(c(T,T,F,T,F,F,9,0,3,1),ncol=3) matrix7 matrix9=matrix(1:1000,nrow=20) matrix9 matrix9[6, ] matrix9[ ,40] matrix9[6,4] class(matrix9) Char3="ARRAY DATA TYPE" Char3 array1=array(1:16,dim=c(4,2,2)) array1 array2=array(1:1000,dim=c(10,10,10)) array2 class(array2) Char4="DATA FRAME DATA TYPE" Char4 myvalues1=c(1,2,3,4,5) myvalues2=c(T,F,T,T,T) names=c("row1","row2","row3","row4","row5") dataframe1=data.frame(myvalues1, myvalues2,row.names=names) dataframe1 names(dataframe1)[1]="HOUSE" dataframe1 Char5="VECTORS" Char5 vector1=1:9 vector1 vector2=9:1 vector2 vector3=1.2:9 vector3 Char6="VECTORS IN RANDOM FORM" Char6 vector4=c(1,5,8,-1) vector4 vector5=c(1,5,8,-1.2) vector5 Char7="OPERATIONS ON VECTOR:- 1:- ADDITION" Char7 vector6=vector5+4 vector6 vector7=vector4+vector5 vector7 Char8="vector subtraction" Char8 vector8=vector5-4 vector8 vector9=vector4-vector5 vector9 v1=1:10 v2=1:30 v3=v1+v2 v1 v2 v3 v4=v1*3 v4 v5=v1*v2 v5 v9=1:10 v10=11:15 v11=v9*v10 v9 v10 v11 Char9="vector division" Char9 v12=v11/2 v12 v13=v11/v12 v13 Char10="MATRICES AND THEIR OPERATIONS" Char10 A=matrix(c(1,3,5,6,9,6),nrow=3) A B=matrix(c(1,3,5,6,9,6),ncol=3) B C=matrix(c(1,3,5,6,9,6,7),ncol=3) C D=matrix(1:8,ncol=3) D E=matrix(v12,nrow=3) E Char11="1:- ADDITION" Char11 F=matrix(1:12,nrow=3) F G=E+F G H=G+5 H Char12="MULTIPLICATION" Char12 I=H*2 I A B J=A%*%A J
run
|
edit
|
history
|
help
0
Grafico
Change text from ALL CAPS to Title Case
R
Julia set variant
Mandelbrotset
Assignment2 Q1
Plot Graph By Adjacency Matrix
Hello, world!
Regressão linear
14-09-2020GRam