Public Member Functions | |
encodeMask (QRinput $input, $mask) | |
Encode mask Main function responsible for creating code. More.. | |
encodeInput (QRinput $input) | |
Encode input with mask detection. More.. | |
encodeString8bit ($string, $version, $level) | |
Encode string, forcing 8-bit encoding. More.. | |
encodeString ($string, $version, $level, $hint, $casesensitive) | |
Encode string, using optimal encodings. More.. |
Static Public Member Functions | |
static | png ($text, $outfile=false, $level=QR_ECLEVEL_L, $size=3, $margin=4, $saveandprint=false) |
Creates PNG image containing QR-Code. More.. | |
static | text ($text, $outfile=false, $level=QR_ECLEVEL_L, $size=3, $margin=4) |
Creates text (1's & 0's) containing QR-Code. More.. | |
static | raw ($text, $outfile=false, $level=QR_ECLEVEL_L, $size=3, $margin=4) |
Creates Raw Array containing QR-Code. More.. | |
static | canvas ($text, $elemId=false, $level=QR_ECLEVEL_L, $width=false, $size=false, $margin=4, $autoInclude=false) |
Creates Html+JS code to draw QR-Code with HTML5 Canvas. More.. | |
static | svg ($text, $elemId=false, $outFile=false, $level=QR_ECLEVEL_L, $width=false, $size=false, $margin=4, $compress=false) |
Creates SVG with QR-Code. More.. |
Public Attributes | |
$version | |
Integer QR code version. Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix. | |
$width | |
Integer Width of code table. Because code is square shaped - same as height. | |
$data | |
Array Ready, masked code data. |
Static Public Attributes | |
static | $jscanvasincluded = false |
Canvas JS include flag. More.. |
| static |
String | $text | text string to encode |
String | $elemId | (optional) target Canvas tag id attribute, if false Canvas tag with auto id will be created |
Integer | $level | (optional) error correction level QR_ECLEVEL_L, QR_ECLEVEL_M, QR_ECLEVEL_Q or QR_ECLEVEL_H |
Integer | $width | (optional) CANVAS element width (sam as height) |
Integer | $size | (optional) pixel size, multiplier for each 'virtual' pixel |
Integer | $margin | (optional) code margin (silent zone) in 'virtual' pixels |
Boolean | $autoInclude | (optional) if true, required qrcanvas.js lib will be included (only once) |
QRinput | $input | data object to be encoded |
QRinput | $input | data object |
Integer | $mask | sugested masking mode |
QRcode::encodeString | ( | $string, |
$version, | ||
$level, | ||
$hint, | ||
$casesensitive | ||
) |
String | $string | input string |
Integer | $version | code version (size of code area) |
String | $level | ECC level (see: Global Constants -> Levels of Error Correction) |
Integer | $hint | QR_MODE_8 or QR_MODE_KANJI, Because Kanji encoding is kind of 8 bit encoding we need to hint encoder to use Kanji mode explicite. (otherwise it may try to encode it as plain 8 bit stream) |
Boolean | $casesensitive | hint if given string is case-sensitive, because if not - encoder may use optimal QR_MODE_AN instead of QR_MODE_8 |
QRcode::encodeString8bit | ( | $string, |
$version, | ||
$level | ||
) |
String | $string | input string |
Integer | $version | code version (size of code area) |
Integer | $level | ECC level (see: Global Constants -> Levels of Error Correction) |
| static |
String | $text | text string to encode |
String | $outfile | (optional) output file name, if false outputs to browser with required headers |
Integer | $level | (optional) error correction level QR_ECLEVEL_L, QR_ECLEVEL_M, QR_ECLEVEL_Q or QR_ECLEVEL_H |
Integer | $size | (optional) pixel size, multiplier for each 'virtual' pixel |
Integer | $margin | (optional) code margin (silent zone) in 'virtual' pixels |
Boolean | $saveandprint | (optional) if true code is outputed to browser and saved to file, otherwise only saved to file. It is effective only if $outfile is specified. |
| static |
String | $text | text string to encode |
Boolean | $outfile | (optional) not used, shuold be false |
Integer | $level | (optional) error correction level QR_ECLEVEL_L, QR_ECLEVEL_M, QR_ECLEVEL_Q or QR_ECLEVEL_H |
Integer | $size | (optional) pixel size, multiplier for each 'virtual' pixel |
Integer | $margin | (optional) code margin (silent zone) in 'virtual' pixels |
| static |
String | $text | text string to encode |
Boolean | $elemId | (optional) target SVG tag id attribute, if false SVG tag with auto id will be created |
String | $outfile | (optional) output file name, when false file is not saved |
Integer | $level | (optional) error correction level QR_ECLEVEL_L, QR_ECLEVEL_M, QR_ECLEVEL_Q or QR_ECLEVEL_H |
Integer | $width | (optional) SVG element width (sam as height) |
Integer | $size | (optional) pixel size, multiplier for each 'virtual' pixel |
Integer | $margin | (optional) code margin (silent zone) in 'virtual' pixels |
Boolean | $compress | (optional) if true, compressed SVGZ (instead plaintext SVG) is saved to file |
| static |
String | $text | text string to encode |
String | $outfile | (optional) output file name, when false file is not saved |
Integer | $level | (optional) error correction level QR_ECLEVEL_L, QR_ECLEVEL_M, QR_ECLEVEL_Q or QR_ECLEVEL_H |
Integer | $size | (optional) pixel size, multiplier for each 'virtual' pixel |
Integer | $margin | (optional) code margin (silent zone) in 'virtual' pixels |
ggplot2
add on package to draw some of the plots. It needs to be loaded only once per session.read.csv()
command grabs the data from a file on the book web site and stores in the data frame locustData
.ggplot()
code stitches together multiple components here shown on different lines: the data and variables; the strip chart itself (with options specifying color and size of dots and width of strips); the axis labels, and the theme. We convert treatmentTime
to a character variable for best results.stat = 'identity'
. We convert year to a categorial variable for best results.tigerData
.sort()
to order categories from most to least frequent. The last step, data.frame()
arranges the frequencies in a column.factor()
to make a new activity variable whose categories (“levels”) are ordered by frequency.ggplot()
tallies the frequency in each category from the data using stat = 'count'
. We’ll use the new, ordered activity variable created in the previous step. We also add an option to rotate the axis labels so they fit on the page.right = FALSE
ensures that abundance value 70 (for example) is counted in the 70-75 bin rather than in the 65-70 bin.ggplot()
method. The option boundary = 0
puts bars between the bin cut points. The option closed = left
ensures that abundance value 70 (for example) is counted in the 70-75 bin rather than in the 65-70 bin.table()
with the names of two categorical variables as arguments, beginning with the response variable.ggplot()
uses the argument fill
for the response variable (here named response
). The argument position
controls the placement of bars. scale_fill_manual
is optional but it allows control of the colors used.ggplot()
. The t()
command flips (transposes) the table to ensure that the explanatory variable is along the horizontal axis.plot()
command. The tilde (~) relates the response variable sonAttractiveness
to the explanatory variable fatherOrnamentation
.ggplot()
, the commands for a scatter plot are as follows.ggplot()
, like that in Figure 2.3-4.facet_wrap()
function indicates the groups (in this case populations), with the tilde “~” indicating that they represent another explanatory variable.geom_line()
and geom_point()
are included.