similar to: subset

Displaying 20 results from an estimated 300 matches similar to: "subset"

2012 Nov 13
4
for loop
HI, You can do this in many ways: dat1<-read.table(text=" med1,med2,med3???? ?1,0,1?????? 0,1,1??? 2,0,0 ",sep=",",header=TRUE)?? #1st method library(reshape) dat2<-melt(dat1) dat3<-aggregate(dat2$value,by=list(dat2$variable),sum) ?colnames(dat3)<-c("name","sum(n11)") ?dat3 #? name sum(n11) #1 med1??????? 3 #2 med2??????? 1 #3 med3??????? 2
2010 Nov 29
2
drop levels problem
Hi all: I am having trouble dropping levels, got a few hints online?without success. Please consider the dataset below: ?I was under the inpression that subset(......drop=TRUE) would work but it doesn't library(ggplot2) ??? library(hmisc) x <- structure(list(first = c(38.2086, 43.1768, 43.146, 41.8044, 42.4232, 46.3646, 38.0813, 40.0745, 40.4889, 38.6246, 40.2826, 41.6056, 34.5353,
2005 Aug 30
2
Doubt about nested aov output
Hi, I have two doubts about the nested aov output. 1) I have this: > anova.ratos <- aov(Glicogenio~Tratamento+Error(Tratamento/Rato/Figado)) > summary(anova.ratos) Error: Tratamento Df Sum Sq Mean Sq Tratamento 2 1557.56 778.78 Error: Tratamento:Rato Df Sum Sq Mean Sq F value Pr(>F) Residuals 3 797.67 265.89 Error: Tratamento:Rato:Figado
2008 Aug 10
1
Macmilan dictionary gives me an error
Hi! As the subject line says, Macmillan dictionary gives me an error msg: Code: wine: Unhandled page fault on read access to 0x003ad6a1 at address 0x36a2e5 (thread 0009), starting debugger... Unhandled exception: page fault on read access to 0x003ad6a1 in 32-bit code (0x0036a2e5). Register dump: CS:0073 SS:007b DS:007b ES:007b FS:0033 GS:003b EIP:0036a2e5 ESP:0032feb4 EBP:0032febc
2008 Nov 12
3
R- transform data frame into matrix
Hello I have the problem that I want to transform a dataframe as generated by diagnosis <- rep(diagnosis[1:3], 3) marker <- gl(3,3) values <- rnorm(9) dataframe <- cbind(diagnosis, marker, values) dataframe <- dataframe[c(1:5, 7:9), ] into a matrix where levels(diagnosis) is indicating the rows of the matrix, levels(marker) the columns and values are the actual content of the
2006 Oct 23
3
Plotting Text on a graph
Hi, I plotted 12 graphs on a page and output to a png file. I wanted to have an overall title for all 12 graphs. What command can I use to do this? Below is the code that plotted the 12 graphs in one page. # FM10 by Month/ Export the plot to Wash2005FM10.png png(file="Wash2005FM10.png",bg="white") par(mfrow = c(3,4)) # Plot 12 Month of OFM10, FFM10 for(i in
2010 Nov 18
3
Plotting number of patients at risk below survival curve
Dear list, does anyone know of a R-package that has implemented the increasingly popular inclusion of the number of patients at risk below Kaplan-Meier curves like in http://bloodjournal.hematologylibrary.org/content/vol116/issue19/images/large/zh89991058760001.jpeg any hint (or negative answer) is much appreciated. Thanks Thorsten -- Thorsten Raff 2nd Medical Department, University
2011 Jul 31
2
XML and odfWeave
Dear R-helpers, this is just a notice to inform everyone that the current versions of XML and odfWeave don't seem to be playing nice with each other. Since it took me quite some time to figure that out, I thought that I let you know. In my case it helped to install an older version of XML but your mileage of course may vary. Best regards Thorsten -- Thorsten Raff 2nd Medical
2009 Sep 09
2
ggplot2: mixing colour and linetype in geom_line
Hi all, I try to represent a multiple curve graphic where the x-axis is the temperature and the different y-axes are the different X (X22,X43,X44...) some X corresponds to the same molecule (22 and 44 are for CO2 for instance) so I use the same colour for them. I wanna mix the linetype with the colour to be able to visually see the difference between X43 and X45 The best I have done up to now
2011 Jun 09
4
contar apariciones en data frame
Hola, ¿qué tal? Llevo un rato dándole vueltas y no encuentro la solución , seguro que es una tontería pero no acabo de verlo. Tengo un data frame de la siguiente forma. TARJETA FECHA 1 2010006207318 2011-02-01 2 2010006207318 2011-02-01 3 2010006209657 2011-02-01 4 2010006209657 2011-02-01 5 2010006209657 2011-02-01 6 2010006209657 2011-02-01 7
2012 Mar 20
3
Agregar variables de un dataframe
Hola a todos.Quiero saber si existe una forma mas apropiada para hacer esto:tengo un dataframe de 40 variables y una de ellas es de fechas.lo que quiero es una tabla agregada por suma y como criterio de agrupación esta variable de fecha.en sql sería algo así: select fecha, sum(v1), sum(v2)..., sum(v39)from tablagroup by fecha; mi problema es que las vn pueden ser de dimensión cambiante, es decir,
2019 Feb 16
4
Duda error sintaxis
Buenas tardes chicos, estoy intentando hacer un gráfico que resuma para cada dia de la semana la información de algunos distritos específicos de los que contiene mi variable, ejecuto esta sintaxis pero me da un error Error: Mapping should be created with `aes() or `aes_()`. Alguien me puede orientar sobre que estoy haciendo mal, llevo mucho rato atascada. Muchas gracias df_nuevofinal %>%
2011 Nov 30
1
Nomogram with stratified cph in rms package, how to get failure probability
Hello, I am using Dr. Harrell's rms package to make a nomogram. I was able to make a beautiful one. However, I want to change 5-year survival probability to 5-year failure probability. I couldn?t get hazard rate from Hazard(f1) because I used cph for the model. Here is my code: library(rms) f1 <- cph(Surv(retime,dfs) ~ age+her2+t_stage+n_stage+er+grade+cytcyt+Cyt_PCDK2 , data=data11,
2018 Jun 22
3
loop con matriz que cambia de nombre
Buenos días. Quiero hacer un for (j), anidado en otro for (i). En el 2º for, en cada iteración ha de crear una matriz vacía: mat <- matrix(nrow=nrow(data),ncol=19) pero llamándola de forma distinta cada vez. El nombre ha de ser: paste("D",i,colnames(Data[j]),sep=""). Llevo un rato haciendo pruebas pero no me sale. A ver si alguien pudiera ayudarme, gracias, Manuel
2018 Sep 04
3
Lectura Archivo JSON
Hola comunidad eRrera, Acudo a ustedes después de pelearme un rato y salir perdedor con la lectura de un archivo json. Por el momento he conseguido leerlo y transformar la parte que me interesa a data frame, sin embargo no consigo poder manipular los datos para calcular por ejemplo la media de una de las variables. El código que estoy ejecutando es: library(jsonlite) json_data <-
2012 Mar 27
1
survplot function
Dear R-helpers I am wondering if there is an option to the survplot function in the design package that allows for drawing Kaplan-Meier plots starting from 0 instead of 1, similar like fun = 'event' in the standard plotting function used on a survfit object. I apologize in advance for having missed any obvious informational sources but I really didn't find anything in the
2018 Jun 22
4
loop con matriz que cambia de nombre
Funciona, me crea una matriz en cada iteración, con un nombre que incluye el nº de la iteración. Me surge ahora el problema de que, dentro del mismo bucle la quiero convertir en df y ponerle nombre a las columnas, y como el nombre de la matriz es distinto cada vez, no sé cómo hacerlo. Supongo que se hará todo al crearla, pero no sé cómo. Un problema adicional es que las variables
2018 Jun 25
2
loop con matriz que cambia de nombre
Gracias Carlos, eso lo sé. El problema, probablemente una chorrada, es que para cambiarle el nombre a las variables (de acuerdo a un patrón, si, que incluye el nº de la iteración), debo indicar el nombre de la df, pero éste no es siempre el mismo. Puedo darle un nombre fijo a la df, ponerle el nombre a las variables, y al final del loop cambiarle el nombre a la df, pero tampoco sé cómo
2012 Jan 18
5
graficos con fechas
Buenas tardes: A la hora de hacer unos graficos en el eje de las X tengo fechas en formato ad.Date (''aaa-mm-dd'', por ejemplo 2011-25-07) y el problema es que no me las considera como tales, sino como factores, y no tiene en cuenta la diferencia entre fechas a la hora de separar las barras entre si (por ejemplo, la distancia entre el 6 de julio y el 8 de julio es la misma que la
2013 Jul 18
3
setdiff y/o intersect para diferencias entre vectores
hola, tengo dos vectores de 1134 y 385 elementos que se corresponden con números de accesión de genes. Necesito saber que números son comunes o intersección de vectores. He utilizado intersect(x,y) y me da todo el rato un único valor: V1 V1.1 V1.2 V1.3 V1.4 V1.5 V1.6 V1.7 V1.8 V1.9 V1.10 V1.11 V1.12 1 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305