read_ftir | R Documentation |
Reads a provided file and returns a data.frame in the proper format for PlotFTIR functions.
Lit un fichier fourni et renvoie un data.frame dans le format approprié pour les fonctions PlotFTIR.
read_ftir(path = ".", file = NA, sample_name = NA, ...)
path |
Path to the file. Default is the current working directory, as Chemin d'accès au fichier. Par défaut, il s'agit du répertoire de travail actuel, sous la forme |
file |
File name, required. If the file and path are provided together as Nom du fichier, obligatoire. Si le fichier et le chemin sont fournis ensemble en tant que |
sample_name |
Name for sample_id column in the returned data.frame. If not provided, the file name is used without the extension. Nom de la colonne sample_id dans le data.frame renvoyé. S'il n'est pas fourni, le nom du fichier est utilisé sans l'extension. |
... |
Additional parameters to pass to the file reading function. For CSV files, see Paramètres supplémentaires à transmettre à la fonction de lecture de fichier. Pour les fichiers CSV, voir |
a data.frame containing the spectral data from the file.
un data.frame contenant les données spectrales du fichier.
read_ftir_directory()
# Writing a temporary file to read later
tf <- tempfile(fileext = ".csv")
write.csv(sample_spectra[sample_spectra$sample_id == "paper", c("wavenumber", "absorbance")],
file = tf, row.names = FALSE
)
# Read the .csv file and call the sample `sample1`
read_ftir(tf, sample_name = "sample1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.