Learn R Programming

vegtable (version 0.1.3)

write_juice: Exporting Tables for ‘Juice’.

Description

This function produce txt files as inport formats for ‘Juice’ (http://www.sci.muni.cz/botany/juice/).

Usage

# S4 method for vegtable,character,formula
write_juice(data, file, formula,
	header=c("COUNTRY","REFERENCE"), coords=c("LONGITUDE","LATITUDE"), FUN, ...)

Arguments

data

An object of class vegtable.

file

Character value indicating the name of output files (without file extension).

formula

A formula passed to crosstable.

header

Variables of header to be exported.

coords

Names of coordinate variables in header of 'data'.

FUN

Funtion passed to crosstable.

...

Further arguments passed to the function crosstable.

Details

This function produces two output files to be imported into a ‘Juice’ file: A vegetation table produced by crosstable and a header table. Both tables share the file name plus a suffix (table for the vegetation table and header for the header).

For the import in ‘Juice’, you may start with the table following in the menu 'File -> Import -> Table -> from Spreadsheet File (e.g. EXCEL Table)' and then follow the wizard. You further import the header table following in the menu 'File -> Import -> Header Data -> From Comma Delimited File'. Notice that the vegetation is a semi-colon delimited file, while the header is a comma delimited file.

Examples

Run this code
# NOT RUN {
library(vegtable)
data(Kenya_veg)

## Only first 20 observations
Kenya_veg <- Kenya_veg[1:20,]
# }
# NOT RUN {
write_juice(Kenya_veg, "SWEA", FUN=mean)
# }

Run the code above in your browser using DataLab