Documentos de Académico
Documentos de Profesional
Documentos de Cultura
PYTHON R
-------------------------------------------------
x = 3 x <- 3
True, False T, F
TRUE, FALSE
** ^
// %/%
% %%
@ %*%
v = [2,3,4]
v = np.array([2,3,4]) v <- c(2,3,4)
1:5
range(5) seq(5)
0,1,2,3,4 1,2,3,4,5
np.arange(4,7,0.5) seq(4,7,by=0.5)
4 4.5 5 5.5 6 6.5 4 4.5 5 5.5 6 6.5 7
np.linspace(2,3,11) seq(2,3,length=11)
2 2.1 2.2 ... 2.9 3
m.T t(m)
np.linalg.solve solve
m[:,2] m[,3]
np.random.randn rnorm
np.random.rand runif
np.random.randint sample(1:6, 10, replace=T)
if cond: if (cond) {
B1 B1
else: } else {
B2 B2
}
for k in s: for (k in s) {
B B
}
global x x <<- 3
x = 3
https://notebooks.gesis.org/binder/jupyter/user/albertoruiz-inforfis-k0dkac3q/notebooks/notebooks/
intro-R.ipynb