Statistical independence and conditional independence are the fundemental concepts in statistics and machine learning. Copula Entropy is a mathematical concept for multivariate statistical independence measuring and testing, and also closely related to conditional independence or transfer entropy. It has been applied to solve several statistical or machine learning problems, including association discovery, structure learning, variable selection, and causal discovery. Copula entropy was proposed to be estimated nonparametrically with rank statistic and the kNN method for estimating entropy. copent, is a R package which implements this proposed method for estimating copula entropy. The implementation detail of the package is presented in this paper. Two illustration examples with simulated data and real-world data on causal discovery are also presented. The copent package is available on the Comprehensive R Archive Network (CRAN) and also on GitHub at https://github.com/majianthu/copent.