R study notes

Monday, October 20, 2014

Exercises-8

Given a vector x determine if x is sorted in ascending order



if(n<=0)
{
      fact=1
}

else
{
     face=1
     for (i in 2:n)
     {
           fact=fact*i
     }
}
Posted by little6 at 8:14 PM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

little6
View my complete profile

Blog Archive

  • ►  2015 (2)
    • ►  November (1)
    • ►  February (1)
  • ▼  2014 (58)
    • ►  November (9)
    • ▼  October (29)
      • R语言系列:简单作图
      • R语言矩阵运算
      • R语言绘图 制图的一些要点
      • Exercise-11
      • Exercise-10
      • Exercise-9
      • Exercises-8
      • Random Code in Class 10/13/2014
      • Exercises-3
      • Exercises-2
      • Exercises-1
      • sets {base}
      • match
      • The %in% operator in R
      • R软件中排序:sort(),rank(),order()
      • R unname Function
      • R dim Function
      • “e” 科学记数:
      • Printing Fewer Digits (or More Digits)
      • Complex
      • statistical info
      • %%, %/% operators
      • cat
      • get
      • R书精选
      • Finding and removing duplicate records
      • Class assignment: fibonacci
      • Writing text and output from analyses to a file
      • R基本数据类型转换?
    • ►  September (20)
Simple theme. Powered by Blogger.