Plugin SyntaxHighlighter

Este plugin (https://es.wordpress.org/plugins/syntaxhighlighter) se utiliza para insertar código en cualquier entrada de wordpress. La documentación incluida es muy clara.

Código en R

[sourcecode lang=”r”]

> ### Examples from: "An Introduction to Statistical Modelling"
> ### By Annette Dobson
> ###
> ### == with some additions ==
>
> # Copyright (C) 1997-2008 The R Core Team
>
> require(stats); require(graphics)

> ## Plant Weight Data (Page 9)
> ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) > trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) > group <- gl(2,10, labels=c("Ctl","Trt")) > weight <- c(ctl,trt) > anova (lm(weight~group))
Analysis of Variance Table

Response: weight
Df Sum Sq Mean Sq F value Pr(>F)
group 1 0.6882 0.68820 1.4191 0.249
Residuals 18 8.7292 0.48496

> summary(lm(weight~group -1))

Call:
lm(formula = weight ~ group – 1)

Residuals:
Min 1Q Median 3Q Max
-1.0710 -0.4938 0.0685 0.2462 1.3690

Coefficients:
Estimate Std. Error t value Pr(>|t|)
groupCtl 5.0320 0.2202 22.85 9.55e-15 ***
groupTrt 4.6610 0.2202 21.16 3.62e-14 ***

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ‘ 1

Residual standard error: 0.6964 on 18 degrees of freedom
Multiple R-squared: 0.9818, Adjusted R-squared: 0.9798
F-statistic: 485.1 on 2 and 18 DF, p-value: < 2.2e-16 > ## Birth Weight Data (Page 14)
> age <- c(40, 38, 40, 35, 36, 37, 41, 40, 37, 38, 40, 38, + 40, 36, 40, 38, 42, 39, 40, 37, 36, 38, 39, 40) > birthw <- c(2968, 2795, 3163, 2925, 2625, 2847, 3292, 3473, 2628, 3176, + 3421, 2975, 3317, 2729, 2935, 2754, 3210, 2817, 3126, 2539, + 2412, 2991, 2875, 3231) > sex <- gl(2,12, labels=c("M","F"))

[/sourcecode]

Código en PHP

[sourcecode lang=”php”]
<!DOCTYPE HTML>
<html>
<head>
<title>Ejemplo</title>
</head>
<body>

<?php echo "¡Hola, soy un script de PHP!"; ?>

</body>
</html>
[/sourcecode]

Código de MySQL

[sourcecode lang=”php”]
CREATE TABLE `basedatosmysql` (
`id` smallint(7) unsigned NOT NULL auto_increment,
`nombre` varchar(50) NOT NULL default ”,
`categoria` varchar(50) NOT NULL default ”,
`descripcion` text NOT NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=0 AUTO_INCREMENT=8140 ;

[/sourcecode]