The bnlearn R package provides a free implementation of Bayesian network structure learning algorithms, supporting both discrete and continuous variables. It includes constraint-based and score-based algorithms, with the ability to use parallel computing via the snow package. The package offers various network scores and conditional independence tests, along with advanced plotting options via Rgraphviz. It supports both discrete and continuous data, and allows users to choose learning algorithms based on statistical criteria. The package includes constraint-based algorithms like Grow-Shrink, Incremental Association, and Max-Min Parents and Children, as well as score-based algorithms like Hill-Climbing. Conditional independence tests are available for both discrete and continuous data, including mutual information, Pearson's X², and Fisher's Z. The package also allows for arc whitelisting and blacklisting to incorporate prior knowledge. A simple example demonstrates the use of bnlearn to learn a Bayesian network from data, compare different algorithms, and visualize the results. The package is versatile, handling both discrete and continuous data, and supports a wide range of learning algorithms and statistical tests. It is particularly useful for experimental data analysis and provides a single object class (bn) for all algorithms, along with utility functions for descriptive statistics and inference. The package is compared to other Bayesian network learning packages, highlighting its flexibility and performance in learning network structures.The bnlearn R package provides a free implementation of Bayesian network structure learning algorithms, supporting both discrete and continuous variables. It includes constraint-based and score-based algorithms, with the ability to use parallel computing via the snow package. The package offers various network scores and conditional independence tests, along with advanced plotting options via Rgraphviz. It supports both discrete and continuous data, and allows users to choose learning algorithms based on statistical criteria. The package includes constraint-based algorithms like Grow-Shrink, Incremental Association, and Max-Min Parents and Children, as well as score-based algorithms like Hill-Climbing. Conditional independence tests are available for both discrete and continuous data, including mutual information, Pearson's X², and Fisher's Z. The package also allows for arc whitelisting and blacklisting to incorporate prior knowledge. A simple example demonstrates the use of bnlearn to learn a Bayesian network from data, compare different algorithms, and visualize the results. The package is versatile, handling both discrete and continuous data, and supports a wide range of learning algorithms and statistical tests. It is particularly useful for experimental data analysis and provides a single object class (bn) for all algorithms, along with utility functions for descriptive statistics and inference. The package is compared to other Bayesian network learning packages, highlighting its flexibility and performance in learning network structures.