Displaying 9 results from an estimated 9 matches similar to: "Simplifying my code"
2010 Mar 30
2
Need help to split a given matrix is a "sequential" way
I need to split a given matrix in a sequential order. Let my matrix is :
> dat <- cbind(sample(c(100,200), 10, T), sample(c(50,100, 150, 180), 10,
> T), sample(seq(20, 200, by=20), 10, T)); dat
[,1] [,2] [,3]
[1,] 200 100 80
[2,] 100 180 80
[3,] 200 150 180
[4,] 200 50 140
[5,] 100 150 60
[6,] 100 50 60
[7,] 100 100 100
[8,] 200 150 100
[9,]
2010 Oct 15
7
Problem with merging two zoo objects
Dear all, I have following 2 zoo objects. However when I try to merge those 2 objects into one, nothing is coming as intended. Please see below the objects as well as the merged object:
> dat11
V2 V3 V4 V5
2010-10-15 13:43:54 73.8 73.8 73.8 73.8
2010-10-15 13:44:15 73.8 73.8 73.8 73.8
2010-10-15 13:45:51 73.8 73.8 73.8 73.8
2010-10-15 13:46:21 73.8 73.8 73.8 73.8
2008 Oct 08
1
Choose subset for plot use (bwplot)
Hello, this code below was from a helpful R-help user.
dat <- read.csv("Resid_fix2.csv", sep="," , header=T)
dat11 <- dat[1:413,]
# convert ambiguous columns to factors:
dat11$Pri_No <- factor(dat11$Pri_No)
dat11$RecovUnit <- factor(dat11$RecovUnit)
# plot:
require(lattice)
bwplot(bbED~ Pri_No | RecovUnit, data=dat11, as.table=TRUE, layout=c(4,1))
This works,
2011 Jul 02
5
How many times occurs
Hi all,
I have a data matrix likein "input.txt"
8 9 2 5 4 5 8 5 6 6
8 9 2 8 9 2 8 9 2 1
8 9 2 5 4 5 8 5 6 4
8 9 2 5 4 5 8 5 6 6
8 9 2 8 9 2 8 9 2 1
8 9 2 5 4 5 8 9 2 2
In this example will be an 6x10 matrix (or data frame)
I want to detect how many times in a row appears this combination 8 follewd
by 9 followed by 2, and create a new matrix with only this number of occurs
then
2014 Jul 02
2
error al leer una linea desde un archivo de texto
A mi también me funciona para los dos casos:
> dat <- read.csv("d11-16.csv", header=FALSE, sep=",", dec=".", skip=11,
nrows=1)
> dat
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11
1 masa total en µg 30.04633 ug PEAKS MUY PEQUENOS NA NA NA NA NA NA NA
> dat18 <- read.csv("d11-18.csv", header=FALSE,
2012 Jun 06
1
error calling Winbugs using R2WinBugs to run a multi-level model
Dear all,
I'm calling Winbugs (1.4.3) through R2WinBugs (2.1-18 coda_0.14-7) to
fit a switching random walk model, but come up with an instant trap
with the log only displaying 'check('.
I will paste the trap with session info below; I'd be very grateful
for any ideas.
Couple of leads:
1. I presume the problem relates to the r package itself or the way I
call bugs(), because I
2011 Dec 22
5
Como calcular la media de una gran cantidad de flow.frame en un ciclo "for" ...
Queridos amigos tengo el siguiente problema:
Tengo alrededor de 100 archivos del tipo flowFrame (datos de citometria)
que he importado a R. Estos archivos tienen 6 columnas y 10.000 (diez mil)
filas. Tengo que calcular el promedio de la quinta columna y graficarlo
contra el promedio de la segunda columna. La segunda columna tiene el mismo
valor para las 10.000 filas en cada archivo asi es que
2007 Apr 16
1
Export multiple data files from R
An embedded and charset-unspecified text was scrubbed...
Name: inte tillg?nglig
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070416/912fba6b/attachment.pl
2014 Jul 02
7
error al leer una linea desde un archivo de texto
Estimada comunidad, estoy extrayendo una linea de texto desde varios
archivos (unos 200) de esta manera:
dat <- read.csv(filenames[i], header=FALSE, sep=",", dec=".", skip=11,
nrows=1)
pero al tratar de leer esa linea desde el archivo numero 54 obtengo el
siguiente error:
Error in type.convert(data[[i]], as.is = as.is[i], dec = dec, na.strings
= character(0L)) :