isaid
April 26, 2020, 7:17pm
1
I learned to making histogram and CDF/ogive. There is a code looks like:
xs <- seq(floor(min(x)), ceiling(max(x)),0.1)
x is some vector in integers. What if i write the code without floor/ceiling function?
also, can anybody explain aboud ecdf function? I have code like this:
plot(xs,ecdf(x)(xs),type="l",
xlab="Height in Inches, ylab="F(x)")
if you don't mind, please explain about type function too
jlacko
April 26, 2020, 8:21pm
2
Each vector has a single minimum and maximum; ceiling and floor will round each element of your vector to the nearest integer; floor to the nearest lower integer, ceiling to the nearest upper integer.
And because verba docent, exempla trahunt consider this code:
asdf <- c(1/4, 7/4)
min(asdf)
[1] 0.25
max(asdf)
[1] 1.75
floor(asdf)
[1] 0 1
ceiling(asdf)
[1] 1 2
Note how min & max return a single value, and floor & ceiling return a vector of equal lenght of your input (just rounded, up or down).
isaid
April 27, 2020, 7:46am
3
Thank you so much for youe help!
system
Closed
May 4, 2020, 7:46am
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.