- Generate 3 random integers (not be a decimal no.) between 100 and 999 which is divisible by 5
sample(100:999, 3)
[1] 251 446 473
As you can see, what is the code to get random number that is only divisible by 5?
- R program which accepts the group of alphabet characters from the user and count the occurrence of each character. Also find the frequency.
X<-("The percentage of page views that a particular SKU receives relative to the number of page views for all products")
X
[1] "The percentage of page views that a particular SKU receives relative to the number of page views for all products"
nchar(X)
[1] 113
library(stringr)
str_count(X, "a")
[1] 9
str_count(X, "b")
[1] 1
count(X, '1')
X1 freq
1 1 1
As you can see, I am unable to find the frequency for a specific character? please suggest some different approach. thanks in advance