Skip to content

This repository contains a script that draws a festive Christmas tree using the "crayon" package in R. Easily generate a colourful tree directly in your R console, with options to customise and personalise the design. Perfect for adding some holiday cheer to your coding projects!

License

Notifications You must be signed in to change notification settings

linuschirchir/How-to-Draw-a-Christmas-Tree-Using-Crayon-in-R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Draw a Christmas Tree Using Crayon in R

This repository contains code and instructions to draw a Christmas tree using the crayon package in R, as explained in the Medium article by Linus Chirchir.

Christmas Tree

Table of Contents

Introduction

This project demonstrates how to use the crayon package in R to draw a festive Christmas tree. The tree is created using simple R code, making it a great example of how to create art with code. Follow the steps below to replicate the tree and learn more about the process.

Prerequisites

Before you begin, ensure you have the following installed:

  • R (version 3.6 or later)
  • RStudio (optional, but recommended for ease of use)
  • crayon package

Installation

To get started, you need to install the crayon package. You can do this directly from CRAN:

install.packages("crayon")

Clone this repository to your local machine:

git clone https://github.com/your-username/christmas-tree-crayon.git
cd christmas-tree-crayon

Drawing the Christmas Tree

The main script for drawing the Christmas tree is included in the tree.R file. You can run this script in your R environment:

source("tree.R")

This script uses the crayon package to color and create the tree shape directly in the R console.

Customisation

Feel free to customize the tree by modifying the script:

  • Colors: Change the colors of the tree, decorations, or star by adjusting the crayon functions.
  • Tree Size: Modify the size of the tree by altering the loop parameters or the number of lines in the script.
  • Decorations: Add more decorations or change their positions to create a unique design.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Happy coding and Merry Christmas! 🎄

About

This repository contains a script that draws a festive Christmas tree using the "crayon" package in R. Easily generate a colourful tree directly in your R console, with options to customise and personalise the design. Perfect for adding some holiday cheer to your coding projects!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages