Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N <- seq(from=100,to=2000,by=1)
- P <- choose(N-100, 50) / choose(N, 60)
- ## Normalization of Ps:
- sum(P)
- P <- P / sum(P)
- ## Plot it:
- plot(N, P, type = "l",las=1)
- P[which(N) = 386]
- # Set seed for reproducible example
- set.seed(42)
- # Create a dataframe of random numbers
- mydf <- data.frame(X=rnorm(45),Y=rnorm(45))
- # For example set the value of 5th element to 386 as in your question
- mydf$X[5] <- 386
- # Print the fifth value of Y
- print(mydf$Y[5])
- # Use to find X where it is value and print equivalent value of Y
- print(mydf$Y[which(mydf$X==386)])
- P[which(N == 386)]
Add Comment
Please, Sign In to add comment