stringsAsFactors = FALSE
.Here is an explanation of the columns:
summary()
.low
< 60high
> 75medium
between 60 and 75Then try your function by evaluating: 35, 12, 60, 90.
Add other conditions to your function:
Notice: you have to be really carefull. Only one output is correct.
Hint: you can do this exercise in several ways; for example, you can nest conditionals or you can use them in series. You are not obligated to use all three if, if else and else.
Then try your function by evaluating: 35, 12, 60, 110, -3, “A”.
GC percentages of CpG island
on chrX and put them into a
vector. Use the function you wrote above.cpgi
keeping only CpG island on chrY, then order
rows by perGc
values (increasing). Print GC percentage
classes of CpG islands until perGc value is < 65
. Hint:
use a while()
loop with an increasing index. What happens
if you do not order values before using while loop?for
statements, one inside the other.v
containing 10 personal names.
Then:v
and
assign a name to each element by taking a random number from a gaussian
distribution. Then print the element of the vector with its nameAre there any missing values? At the end test the matrix using
is.na()
while
loop that at each iteration add a number
in the vector x
from a gaussian distibution (with mean 0
and sd 1.5) but terminates if you get a number bigger than 3.