See help(Sys.sleep)
.
For example, from ?Sys.sleep
testit <- function(x)
{
p1 <- proc.time()
Sys.sleep(x)
proc.time() - p1 # The cpu usage should be negligible
}
testit(3.7)
Yielding
> testit(3.7)
user system elapsed
0.000 0.000 3.704
More Related Contents:
- In R, how to turn characters (grades) into a number and put in a separate column
- How to find the statistical mode?
- Workflow for statistical analysis and report writing
- R tick data : merging date and time into a single object
- Why am I getting “algorithm did not converge” and “fitted prob numerically 0 or 1” warnings with glm?
- Linear Regression loop for each independent variable individually against dependent
- Function to calculate R2 (R-squared) in R
- Changing whisker definition in geom_boxplot
- Animated sorted bar chart with bars overtaking each other
- Geometric Mean: is there a built-in?
- Using cbind on an arbitrarily long list of objects
- Plotting a 3D surface plot with contour map overlay, using R
- How to generate distributions given, mean, SD, skew and kurtosis in R?
- Exact number of bins in Histogram in R
- Interpretation of ordered and non-ordered factors, vs. numerical predictors in model summary
- Standard Deviation in R Seems to be Returning the Wrong Answer – Am I Doing Something Wrong?
- Stepwise regression using p-values to drop variables with nonsignificant p-values
- predict.lm() in a loop. warning: prediction from a rank-deficient fit may be misleading
- Add error bars to show standard deviation on a plot in R
- Calculating percentile of dataset column
- How to shade a region under a curve using ggplot2
- Efficient calculation of matrix cumulative standard deviation in r
- How to use the ‘sweep’ function
- R optimization with equality and inequality constraints
- What does the period mean when used with ~ (in a formula)?
- Nested facets in ggplot2 spanning groups
- Generate an incrementally increasing sequence like 112123123412345
- Extract rows for the first occurrence of a variable in a data frame
- Plot background colour in gradient
- Draw lines between different elements in a stacked bar plot