similar to: readLines with space-delimiter?

Displaying 20 results from an estimated 500 matches similar to: "readLines with space-delimiter?"

2012 Nov 22
1
Partial dependence plot in randomForest package (all flat responses)
Hi, I'm trying to make a partial plot with package randomForest in R. After I perform my random forest object I type partialPlot(data.rforest, pred.data=act2, x.var=centroid, "C") where data.rforest is my randomforest object, act2 is the original dataset, centroid is one of the predictor and C is one of the classes in my response variable. Whatever predictor or response class I
2017 Aug 14
2
Promedio elementos vector
Buenas noches estimados colegas: Adjunto la matriz,de la que quiero obtener, los promedios de cada elemento de los vectores que la componen. Me explico, el primer vector, tiene como primer elemento 23 y la suma de todos los elementos es 134; por lo tanto el promedio será 0.1716, el segundo elemento de dicho vector es 20, entonces el promedio sería 0.1492, del tercero el promedio es 0.1343 y así
2011 Sep 08
1
3D plot RGL
Hi, anyone has experience with 3D plot (ex: in package RGL) I have a question, I draw a 3D plot of country, year and sales in z axis but when the type is "h" then it's ok but when I want to link the points and type is 'l' lines it's a mess Is there a way to link the points only in one direction? For example a unique line from each country through each year? The code
2010 Jul 20
1
Random Forest - Strata
Hi all, Had struggled in getting "Strata" in randomForest to work on this. Can I get randomForest for each of its TREE, to get ALL sample from some strata to build tree, while leaving some strata TOTALLY untouched as oob? e.g. in below, how I can tell RF to, - for tree 1 in the forest, to use only Site A and B to build the tree, while using the WHOLE Site C data for the oob error
2011 Mar 21
3
Replacing Period in String
Dear R Users, I am working with gsub for the first time. I am trying to remove some characters from a string. I have hit the problem where the period is the shorthand for 'everything' in the R language when what I want to remove is the actual periods. In the example below, I simply want to remove the periods as I have removed the comma, but instead the complete string is wiped out. I
2004 Oct 21
3
error in plot.dendrogram (PR#7300)
Hi, hres <- hclust(smatr,method="single") hresd<-as.dendrogram(hres) as.dendrogram(hres) `dendrogram' with 2 branches and 380 members total, at height 2514.513 plot(hresd,leaflab="none") #<-error here. #the plotted dendrogram is incomplete. The x axis is not drawn. #The interested reader can download the save(hresd,file="hres.rda") #from the
2014 Sep 08
3
problema con los cambios de marcas temporales en el eje X
Hola de nuevo, acabo de encontrar la solución. He creado una variable ficticia con los días 1 de cada mes en la secuencia temporal que quería y después he actuado de la siguiente manera attach(Libro1) plot (xbar~as.Date(fecha,"%d/%m/%y"), type="b", pch=19,cex=2,xaxt="n") xlabels<-strptime(ofeje, format = "%d/%m/%y") axis.Date(1,
2014 Sep 08
3
problema con los cambios de marcas temporales en el eje X
Muchísimas gracias Carlos, de verdad que te agradezco la ayuda, pero no es lo que voy buscando. Quiero colocar en el eje de abscisas la secuencia temporal de los meses, es decir, agosto septiembre, octubre, etc? pero no las fechas de las toma de datos, sino que aparezca la marca de un mes, y la siguiente marca sea la del siguiente mes, etc?, y además que las muestras estén separadas de acuerdo con
2012 Aug 30
2
Help on Plot Title where text is "mixed" with numerical carachters
Dear All,   I have the following code set up:   x <-2000 y <-8 z <-3   I would need to use these numbers to show up in my plot title "mixed" with text. The x,y,z numbers would need to change, the text would not. So my title should look like this   "x txt1 y txt2 z txt3"   so if: txt1=hours txt2=minutes txt3=seconds   then my title of the plot should read:   2000 hours
2011 May 08
1
new to loops
I have never made a loop on my own to do anything in R. But I am hoping someone can help me build one for the following issue: I need to make a univariate logistic regression for each of my variables (about 62 of them), then I need to gather up each of their coefficients (not the intercepts), each of their 95% confidence intervals, and each of thier odds ratios and place them in a matrix to
2016 Sep 02
2
Ayuda con gráfico típico de histograma más linea
Y bueno, algo más bonito sí que queda con ggplot... #--------------- datIn <- read.csv("pec.csv", header = TRUE, sep = ";", dec = ",") library(ggplot2) lab_x_idx <- c(1, round(nrow(datIn)/2, 0), nrow(datIn)) lab_x <- as.vector(datIn$hora[ lab_x_idx]) fre_gg <- ggplot( datIn, aes( x = 1:nrow(datIn), y = frec)) + geom_bar(stat =
2016 Sep 02
2
Ayuda con gráfico típico de histograma más linea
Buenas tardes, Tengo una duda con gráficos. Estoy intentando realizar el típico gráfico de una variable en histograma y otra en linea, supongo que será sencillo pero llevo unos días peleando y no me sale de forma correcta. Las variables están en un dataframe que muestran las frecuencias de tweets minuto a minuto y el share de esos minutos (os adjunto un archivo en csv con el dataframe). Una
2016 Sep 03
2
Ayuda con gráfico típico de histograma más linea
Prueba algo así: library(ggplot2) datos <- read.table("Downloads/pec.csv", header = T, sep = ";", dec = ",") datos$Miles <- as.numeric(gsub("\\.", "", as.character(datos$Miles))) datos$hora <- strptime(datos$hora, format = "%H:%M") ggplot(datos, aes(x = hora, y = Miles)) + geom_line() + scale_x_datetime(date_breaks =
2015 Oct 27
2
pregunta
Otras variantes con y sin paquetes adicionales... > sapply(split(datIn$Gain, as.factor(datIn$Diet)), mean) d1 d2 d3 280 278 312 > by(datIn$Gain, datIn$Diet, mean) datIn$Diet: d1 [1] 280 -------------------------------------------------------------- datIn$Diet: d2 [1] 278 -------------------------------------------------------------- datIn$Diet: d3 [1] 312 > > library(dplyr) >
2014 Sep 08
2
problema con los cambios de marcas temporales en el eje X
Muchas gracias Carlos, previo a mi correo, entre las pruebas que hice estaba una parecida a la que apuntas de la siguiente manera: attach (Libro1) plot (xbar~as.Date(fechas,"%d/%m/%y"), ylim=c(400,660), xaxt="n", type="b", pch=19,cex=1) xlabels<-strptime(fecha,format="%d/%m/%Y") axis.Date (1,at=xlabels,format="%b-%y")
2015 Oct 28
2
pregunta
Me gusta la respuesta uqe has dado, pero si por ejemplo, alguno de los datos tiene datos faltantes, entonces devuelve NA. He probado con: sapply(split(datos$uno, as.factor(datos$dos)), mean(na.rm=TRUE)) pero da fallo. ¿Cómo se podría hacer para que devolviera además la media obviando los NA y que contara el numero de NA por categoria? > Date: Wed, 28 Oct 2015 00:13:45 +0100 > From: cof
2015 Oct 27
3
pregunta
Estimados Cuando existia epicalc, había una manera muy fácil de determinar la media de una variable (en esta caso Gain) por grupos, en este caso (Diet). ?Como se puede hacer ahora? Diet Gain 1 d1 270 2 d1 300 3 d1 280 4 d1 280 5 d1 270 6 d2 290 7 d2 250 8 d2 280 9 d2 290 10 d2 280 11 d3 290 12 d3 340 13 d3 330 14 d3 300 15 d3 300
2005 Jan 27
7
getting package version inside .First.lib
Greetings - Is it possible, inside .First.lib, to find out the version number of the package that is being loaded? If only one version of the package has been installed, we could scan the DESCRIPTION file, something like .First.lib <- function(lib, pkg) { library.dynam("spatstat", pkg, lib) dfile <- system.file("DESCRIPTION", package="spatstat")
2016 Aug 29
4
encontrar fechas saltadas
?Hola, "setdiff()" efectivamente funciona sobre vectores numéricos (no fechas). Para fechas, es mejor hacerlo de esta forma (utilizando tus datos): > > Lines <- "fecha hora datos + 20/11/12 2:00:04AM 12.905 + 21/11/12 3:00:04AM 12.889 + 22/11/12 4:00:03AM 12.873 + 23/11/12 5:00:03AM 12.861 + 29/11/12 11:00:03AM 12.804 + " > > datIn <-
2012 Dec 19
2
read.csv reads more rows than indicated by wc -l
When I have a csv file that is more than 6 lines long, not including the header, and one of the fields is blank for the last few lines, and there is an extra comma on of the lines with the blank field, read.csv() makes creates an extra line. I attached an example file; I'll also paste the contents here: A,apple A,orange A,orange A,orange A,orange A,,, A,, ----- wc -l reports that this file