Square_number<-function(a) { for(k in1:a) { n<-k^2 print(n) } } Square_number(5) #Create a function without argument fun<-function() { print(“Printing Numbers from 1 to 8”) for(i in 1:8) { print(i) } } fun() data(mtcars) s<-mtcars$cyl pm<-3 a<-0.08 sm<-mean(s) sts<-sd(s) se<-std/sqrt(length(s)) z<-(sm-pm)/se p<-2*pnorm(-abs(z)) print(z) print(p) if(p<a){ print("Reject the null hypothesis") }else{ print("Failed to reject the null hypothesis") }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter