[R] Non zero padding dates

2015-08-31 Thread Dominic Roye
Hello, How can I convert date-time in which month and day have non zero padding? For example: "2015119_06" ("2015-01-19 06:00") Thanks Dominic [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and m

[R] Number formatting of labels in directlabels with stat_contour (ggplot2)

2015-04-27 Thread Dominic Roye
How can I customize the number formatting of labels in directlabels? It should be integer as in the original dataset. p <- ggplot(temp,aes(lon,lat,z=Pres,colour=..level..))+ stat_contour(bins=30,size=0.5,colour="black")+theme_bw() direct.label(p,list("top.pieces",cex=0.7,colour="red")

[R] Netcdf

2014-08-31 Thread Dominic Roye
Hello, I have an issue with a conection to a ncdf file. ftp://ftp.cdc.noaa.gov/Public/www/X91.116.178.214.242.12.49.49.nc open.ncdf("X91.116.178.214.242.12.49.49.nc") Error in R_nc_open: NetCDF: Unknown file format Error in open.ncdf("X91.116.178.214.242.12.49.49.nc") : Error in open.ncdf tryi

[R] Kriging

2013-11-12 Thread Dominic Roye
Hello, I have a problem with the kriging function. I get this error: "Error in solve.default(matrix(A, n + 1, n + 1)) : system is computationally singular: reciprocal condition number = 5.53457e-17" But it has worked with other data and now I don't understand why this error. Here is a data ex

[R] Split in blocks

2013-07-31 Thread Dominic Roye
Hello, I am a little bit lost on my search for a solution and idea. I would like to split my time serie in blocks of "night". V1 indicates if its night or not. How can i split this kind of cases? Best regards, str(ou[,c(1,3,8)]) 'data.frame': 863 obs. of 3 variables: $ Fecha: POSIXct, forma

[R] Reshape

2013-07-30 Thread Dominic Roye
Hello, I try out to create a new form from the below data.frame. I would like to have this form: V3 Santiago Ourense VigoFerrol 2013-07-04 2013-07-04 07:01:04 .. How can i get this? > str(sunrise) 'data.frame': 24

[R] strftime

2013-05-16 Thread Dominic Roye
Hello, I'm a little surprised about the result of strftime for my data. > str(time) chr [1:315504] "2006-01-01 00:10:00" "2006-01-01 00:20:00" "2006-01-01 00:30:00" ... > str(strftime(time,format="%Y-%m-%d %H:%M:%S")) chr [1:315504] "2006-01-01 00:00:00" "2006-01-01 00:00:00" "2006-01-01 00:00

[R] grup function

2013-04-10 Thread Dominic Roye
Hello, How can i mattch blanks within words, when i have more phrases? c("Shangh i", "Hello here i am","h llo") > gsub(" ","a",c("Shangh i", "Hello here i am","h llo")) [1] "Shanghai""Helloahereaiaam" "hallo" I would like to have [1] "Shanghai" "Hello here i am" "hallo" I hope someo

[R] tapply and functions with more than one objects

2013-01-22 Thread Dominic Roye
Hello, How i can use a costum function in tapply which has more than one variable? I mean sum(x) only needs one object but what when i have a function function(x,y) with more, how i indicate where are the other variables to use?7 I hope someone can help me. Thank you!! Best regards, Dominic

[R] "Thermoisoplethendiagramm"

2013-01-18 Thread Dominic Roye
Hello, I would like to generate isolines of temperature for the 24 hours by the 12 month. Something like hier: http://www.diercke.de/bilder/omeda/800/12351E.jpg. On the x-axis are the month and on the y-axis the 24 hours, than as contour lines the temperature. My data are: 'data.frame': 288 o

[R] Hist with Dates

2013-01-15 Thread Dominic Roye
Hello R-Helpers, I would like to generate the frequencies of dates (data.RData). str(data) Date[1:43748], format: "2001-01-01" "2001-01-01" "2001-01-01" "2001-01-01" ... test <- hist(data,"days",freq=T) > test$counts [1] 27 17 12 15 6 4 5 13 5 13 15 9 7 10 11 21 10 10 9 11 15 7 10

[R] Logical operator and lists

2013-01-08 Thread Dominic Roye
Hello R-Helpers, I have a slight problem with the expresion data[data==""] <- NA which works well for a data.frame. But now i must use the same for a list of data.frames. My idea is data[[]][data==""] but it don´t work. Thanks!! Dominic [[alternative HTML version deleted]] ___

[R] Read many cvs files

2013-01-02 Thread Dominic Roye
Hello R helpers, I would like to automate this code for many files of the same type. But I don´t know how to make it. In particular, i don´t know how to read many files each one as an r object with the name of the file. Then a for loop would be sufficient, right? Many thanks and a happy new year.

Re: [R] do.call

2012-12-06 Thread Dominic Roye
<-as.data.frame(matrix(sample(c(1:20,NA),30,replace=TRUE),ncol=6)) > do.call(paste,c(na.omit(datos),sep=";")) > #[1] "5;18;14;10;17;3" "14;15;15;3;2;20" "8;18;19;17;12;11" > > A.K. > > > > - Original Message - > From: Dom

[R] do.call

2012-12-04 Thread Dominic Roye
Hello, I have a problem with the "do.call-function". I would like to merge the values of more than 30 columns, but not in all of the rows exist values, so with this commando i get a lot of ";" or NA. How get i only the merge of cells with a number? datos$NEW <- do.call(paste, c(datos[,19:53], s

[R] model.table (anova)

2012-09-05 Thread Dominic Roye
Hello everybody, I have a problem with the model.table of anova. I have data (datos2) with 4 cluster (V7), calculated with daisy and hclust. str(datos2) 'data.frame': 56 obs. of 7 variables: $ Estacion: Factor w/ 56 levels "Abradelo","AltoDoRodicio",..: 1 2 3 4 5 6 7 8 9 10 ... $ Invierno:

[R] boxplot of hierachical cluster

2012-09-04 Thread Dominic Roye
Hello everybody, I would like to make boxplots for my hierachical cluster, but only i found a package that not works with the current version. http://acccn.net/cr569/Rstuff/Minka/mining/html/boxplot.hclust.html I hope you can help me. Thank you. Best regards, Dominic library(cluster) cluster.

[R] boxplot - bclust

2012-09-03 Thread Dominic Roye
Hello everybody, I have a problem with the commando of boxplot -bclust. http://127.0.0.1:13155/library/e1071/html/boxplot.bclust.html > data(iris) > bc1 <- bclust(iris[,1:4], 3, base.centers=5) Committee Member: 1(1) 2(1) 3(1) 4(1) 5(1) 6(1) 7(1) 8(1) 9(1) 10(1) Computing Hierarchical Clustering

[R] Error in if-command

2012-08-12 Thread Dominic Roye
Hello everybody, I don't understand what I'm doing wrong. But it isn't possible that each element of the if-condition is tested for each vector element? y <- c(1:20) > y [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 > if (y == c(4,5,9,11,17)) { print("yes") } else { print("no

[R] replace funcion

2012-08-11 Thread Dominic Roye
Hello everybody, I would like to replace or recode a list of numbers between 1 and 12 (total 100). I have tried to make it with recode, but i have two types of replacements. For 1,2,3,4,11,12 => invierno and for 5,6,7,8,9 and 10 => verano. recode(datos.mx1[,7], "1='invierno'; 2='invierno'; 3='in

[R] Hist function

2012-08-07 Thread Dominic Roye
Hello everyone, First i explain my aim. I would like to calculate the frecuency of temperature (datos.mx1, columns 3-6) for each month with the thresholds of table lf.med and lc.med. numero1 <- hist(subset(datos.mx1[,3], datos.mx1$Mes==1),plot=FALSE,breaks=c(min(datos.mx1[,3]),lf.med[1,2],lc.me