A package designed to generate and export Lindenmayer systems (L-systems) in R.
This collection of functions was created as an R-based implementation of LSEx.m, created by Dr Michael Lindner & Prof. Doug Saddy. The functions will be updated over time, hopefully to include more features in-line with the functionality of the original MATLAB-based program, as well as any new features that may be useful. This particular implementation of LSEx was developed with the intention of the outputs being used as stimuli in artificial grammar learning tasks. These tasks have proved to be effective tools to assess implicit statistical learning and hierarchical structure processing (Schmid et al., 2023; Vender et al., 2019), and to drive bilingual experience-modulated changes to resting-state EEG functional connectivity (Sheehan et al., 2026).
- Lindenmayer system generator (
lsex_gen())- Generates pre-defined or custom-configured L-systems using simple input and output specifications.
- Lindenmayer system string exporter (
lsexport_strings())- Exports the strings generated using
lsex_gen()as .txt or .csv files.
- Exports the strings generated using
- Lindenmayer system lengths exporter (
lsexport_lengths())- Exports the lengths of the iterations generated using
lsex_gen()as a .txt file.
- Exports the lengths of the iterations generated using
- Lindenmayer system rules exporter (
lsexport_rules())- Exports the rules used to generate the specified L-system as a .txt file.
- !NEW! Lindenmayer system sub-string replacer (
lsex_replace()) !NEW!- Searches for specified sub-strings in an
lsex_gen()output and replaces them.- This function in particular may exhibit bugs or not work as intended. Further testing will be conducted to ensure stability.
- Searches for specified sub-strings in an
LSEx.R can be installed using the following functions and packages from CRAN:
- The
install_github()function of thedevtoolspackage
install.packages("devtools")
library(devtools)
install_github("alextssheehan/LSEx.R")- The
install_github()function of theremotespackage, a lightweight version ofdevtools:
install.packages("remotes")
library(remotes)
install_github("alextssheehan/LSEx.R")- The
githubinstall()function of thegithubinstallpackage:
install.packages("githubinstall")
library(githubinstall)
githubinstall("LSEx.R")This package is free and may be distributed and modified under the GNU General Public License (GPLv3). This package is distributed without warranty.
The current version of LSEx.R is v0.9.1 (new lsex_replace() function addition).
To view updates and improvements to the package, head to the NEWS file. To suggest new features or improvements, please register a 'new issue' in the Issues section using the 'enhancements' label. To register a bug or error in the code, use the 'bug' label.