Skip to contents

This function generates a metadata file describing a specified file stored in a folder.

Usage

create_metadata_file(
  file_path,
  description,
  author,
  author_email = NULL,
  creation_date = Sys.Date(),
  source = NULL,
  licence = NULL,
  method = NULL,
  repo = NULL,
  doi = NULL,
  notes = NULL,
  metadata_folder = dirname(file_path)
)

Arguments

file_path

Character. The full path of the file for which metadata is to be created.

description

Character. A brief description of the file.

author

Character. The name of the author or creator of the file.

author_email

Character. The email of the author or creator of the file.

creation_date

Date. The date when the file was created (default is the current date).

source

Character. A URL or reference for the source of the data.

licence

Character. The license under which the dataset is provided. Common licenses include:

  • CC0 1.0 (Public Domain Dedication) - No rights reserved, free for any use.

  • CC BY 4.0 (Attribution) - Free to use, with attribution.

  • CC BY-SA 4.0 (Attribution-ShareAlike) - Free to use, with attribution and share-alike.

  • ODbL (Open Database License) - Allows use, modification, and sharing, but derivatives must remain under ODbL.

  • CC BY-NC 4.0 (Attribution-NonCommercial) - Non-commercial use only, with attribution.

  • CC BY-ND 4.0 (Attribution-NoDerivatives) - You can share, but not modify the dataset.

  • GNU GPL - Allows reuse and modification, but derivatives must also be under GPL.

  • MIT License - Permissive, allows reuse in any context with attribution. Specify the license and provide a link if applicable (e.g., CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)).

method

Character. A short description of actions conducted to obtain or modify the dataset (e.g., "crop", "filter") or an indication of the script used to obtain or modify the dataset.

repo

Character. A URL or reference to the repository where the script used to obtain or modify the dataset can be found (e.g., GitHub, Zenodo).

doi

Character. The Digital Object Identifier (DOI) for the dataset or related publication, if available.

notes

Character. Any additional notes about the file.

metadata_folder

Character. The folder where the generated metadata file will be saved. If not specified, the metadata file will be saved in the same folder as the file.

version

Character. The version of the file. If not provided, it will be automatically assigned.

Value

A metadata file saved in the specified metadata folder or the same folder as the file if metadata_folder is not provided.

Examples