Learn R Programming

Rgnuplot (version 1.0.3)

Gpmatrixr2gnu: Save R matrix in gnuplot format

Description

Gpmatrixr2gnu saves an R matrix in a format that can be read by gnuplot

Usage

Gpmatrixr2gnu(rmatrix, gnufile)

Arguments

rmatrix
R matrix
gnufile
gnuplot file name

Value

See Also

Gpinit

Examples

Run this code
#Initialize the gnuplot handle
h1<-Gpinit()
#set gnuplot's additional search directories, to the extdata directory from 
#Rgnuplot (default)
Gpsetloadpath(h1)
#change gnuplot's working directory to be the same as R's working directory 
#(default)
Gpsetwd(h1)
## Not run: 
# nordklim <- read.table(system.file('extdata/NordklimData.tab', package = 
# "Rgnuplot"), stringsAsFactors=FALSE, header=TRUE)
# NKmonths <- c('January','February','March','April','May','June','July',
# 'August','September','October','November','December')
# #choose Helsinki (code 304) and country (code 'FIN') Precipitation (code 601)
# nordklimHelsinkiPrecipitation <- nordklim[which((nordklim$NordklimNumber==304) &
# (nordklim$CountryCode=='FIN') & (nordklim$ClimateElement==601)),c('FirstYear',
# NKmonths)]
# nordklimHelsinkiPrecipitation <- as.matrix(nordklimHelsinkiPrecipitation)
# #save to a data file
# Gpmatrixr2gnu(nordklimHelsinkiPrecipitation, 'NORDKLIM-Helsinki-prec.dat')
# ## End(Not run)
#close gnuplot handle
h1<-Gpclose(h1)

Run the code above in your browser using DataLab