From alberto.carmonabayonas at gmail.com Tue Oct 4 22:24:19 2016 From: alberto.carmonabayonas at gmail.com (albertoca) Date: Tue, 4 Oct 2016 13:24:19 -0700 (PDT) Subject: [datatable-help] Calibrate after fit.mult.impute for a Cox model (rms package) Message-ID: <1475612659441-4725353.post@n4.nabble.com> Hi! I am trying to fit a Cox model with imputed data. However, the calibration function does not seem to work after applying fit.mult.impute. Secondly, which is the best method to validate the model? This is the code... Could anyone help, please? aga_imp =aregImpute (~her2_cox+ecog_cox+bone_cox+nmet3_cox+ascitis_cox+Grade+nlr_cox,data =aga_NA, x=T, nk=0, n.impute =5) ddist=datadist(aga_sinNA) options(datadist="ddist") suv<- with(aga_NA, Surv(time,event)) cox <- fit.mult.impute(suv ~ her2_cox+ecog_cox+bone_cox+nmet3_cox+ascitis_cox+Grade+nlr_cox, cph, aga_imp, data=aga_NA, n.impute=5, pr=F, surv=T, time.inc=365 ) cal<-calibrate(cox, cmethod='KM', method='boot',u=365,B=10) Unfortunately I obtain this: Error in predab.resample(fit, method = method, fit = coxfit, measure = distance, : must have specified x=T and y=T on original fit -- View this message in context: http://r.789695.n4.nabble.com/Calibrate-after-fit-mult-impute-for-a-Cox-model-rms-package-tp4725353.html Sent from the datatable-help mailing list archive at Nabble.com. From jorfega80 at hotmail.com Wed Oct 5 15:59:23 2016 From: jorfega80 at hotmail.com (icecrls) Date: Wed, 5 Oct 2016 06:59:23 -0700 (PDT) Subject: [datatable-help] Unicode symbols do not display on Mac OS X Message-ID: <1475675963662-4725372.post@n4.nabble.com> I am trying to display unicode symbols in a plot, but they do not display on Mac OS X 10.10. I am using cairo_pdf, since this solution worked well on a Fedora 20 OS, but not in this case. I checked I have the Cairo and Pango ports available in my Mac, so the issue might be related with the fonts not being correctly loaded in the R session. Any thoughts? Thanks in advance. cairo_pdf(file='test.pdf') pdfFonts("serif") par(family="serif") plot(1,1, main=expression("\u2600")) dev.off() sessionInfo() R version 3.2.3 (2015-12-10) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.10.5 (Yosemite) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.2.3 -- View this message in context: http://r.789695.n4.nabble.com/Unicode-symbols-do-not-display-on-Mac-OS-X-tp4725372.html Sent from the datatable-help mailing list archive at Nabble.com. From suttoncarl at ymail.com Thu Oct 6 21:54:44 2016 From: suttoncarl at ymail.com (carlsutton) Date: Thu, 6 Oct 2016 12:54:44 -0700 (PDT) Subject: [datatable-help] speed Message-ID: <1475783684617-4725391.post@n4.nabble.com> I was doing a refresher on the Data Camp series on data table. Under the set function section I decided to do a system time to measure just how much faster data table is than base R x <- rep(1:5,1000000 y <- rep(c(1,8,1,1,1),1000000 z <= rep(1:5,1000000) dt <- data.table(x,y,z) system.time for (i in 1:length(x)) dt[i,z := i +1] user time was 2096.27 system.time for (i in 1:length(x)) set(dt,i,3L, i + 1) user time was 14.04 set was faster by 149.31 times! Good going data.table guys and gals Carl Sutton ----- Carl Sutton -- View this message in context: http://r.789695.n4.nabble.com/speed-tp4725391.html Sent from the datatable-help mailing list archive at Nabble.com. From fanfanus at orange.fr Mon Oct 10 19:36:31 2016 From: fanfanus at orange.fr (fanfanus) Date: Mon, 10 Oct 2016 10:36:31 -0700 (PDT) Subject: [datatable-help] Apply formula to several files Message-ID: <1476120991285-4725516.post@n4.nabble.com> Hello everyone, I am a beginner in R. In order to verify my data files (which are tables with values separated by spaces in .txt files), I wanr to count the number of columns in each file. So I made the formula that works: ncol(read.table("my_file.txt", header = FALSE, sep = "")) The problem is I have 257 files to check in the same folder! I would have to automate this function for me to get the number of columns in each of his files. I think I shoud use this formula : list.files(path="C:/.....") But I don't know how to... Could you help me ? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Apply-formula-to-several-files-tp4725516.html Sent from the datatable-help mailing list archive at Nabble.com. From bioglp at gmail.com Mon Oct 10 21:38:01 2016 From: bioglp at gmail.com (glaporta) Date: Mon, 10 Oct 2016 12:38:01 -0700 (PDT) Subject: [datatable-help] Apply formula to several files In-Reply-To: <1476120991285-4725516.post@n4.nabble.com> References: <1476120991285-4725516.post@n4.nabble.com> Message-ID: <1476128281302-4725520.post@n4.nabble.com> list <- list.files() for(i in 1:length(list)){ print(ncol(read.table(list[i], header = FALSE, sep = ""))) } Good luck, Gianandrea -- View this message in context: http://r.789695.n4.nabble.com/Apply-formula-to-several-files-tp4725516p4725520.html Sent from the datatable-help mailing list archive at Nabble.com. From fanfanus at orange.fr Mon Oct 10 21:51:27 2016 From: fanfanus at orange.fr (fanfanus) Date: Mon, 10 Oct 2016 12:51:27 -0700 (PDT) Subject: [datatable-help] *** SPAM *** Re: Apply formula to several files Message-ID: <036e01d22330$a3fa06c0$ebee1440$@orange.fr> Thanks ! De : glaporta [via R] [mailto:ml-node+s789695n4725520h79 at n4.nabble.com] Envoy? : lundi 10 octobre 2016 21:38 ? : fanfanus Objet : *** SPAM *** Re: Apply formula to several files list <- list.files() for(i in 1:length(list)){ print(ncol(read.table(list[i], header = FALSE, sep = ""))) } Good luck, Gianandrea _____ If you reply to this email, your message will be added to the discussion below: http://r.789695.n4.nabble.com/Apply-formula-to-several-files-tp4725516p47255 20.html To unsubscribe from Apply formula to several files, click here . NAML -- View this message in context: http://r.789695.n4.nabble.com/RE-SPAM-Re-Apply-formula-to-several-files-tp4725521.html Sent from the datatable-help mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mithra.chintha at uconn.edu Sun Oct 23 23:33:32 2016 From: mithra.chintha at uconn.edu (Chintha Mithra) Date: Sun, 23 Oct 2016 14:33:32 -0700 (PDT) Subject: [datatable-help] Unable to Import .xls file Message-ID: <1477258412097-4725910.post@n4.nabble.com> Hi All, I am new to R coding and I have to import the .xls format file which was attached . This file has HTML content in the file. I tried the packages available in the R but i am unable to import the data. Kindly Please help me in directing to complete the task. Regards, Mithra -- View this message in context: http://r.789695.n4.nabble.com/Unable-to-Import-xls-file-tp4725910.html Sent from the datatable-help mailing list archive at Nabble.com. From nfields at gmail.com Mon Oct 24 00:39:03 2016 From: nfields at gmail.com (affableambler) Date: Sun, 23 Oct 2016 15:39:03 -0700 (PDT) Subject: [datatable-help] Unable to Import .xls file In-Reply-To: <1477258412097-4725910.post@n4.nabble.com> References: <1477258412097-4725910.post@n4.nabble.com> Message-ID: <1477262343120-4725912.post@n4.nabble.com> Did you try the xlsx package? install.packages("xlsx") mydata <- read.xlsx("myfile.xls") Not sure how well it handles HTML formatting. Your best bet may be to just save it as a tab-delimited text file and use the read.csv function. mydata<- read.csv("myfile.txt", sep = "\t") -- View this message in context: http://r.789695.n4.nabble.com/Unable-to-Import-xls-file-tp4725910p4725912.html Sent from the datatable-help mailing list archive at Nabble.com. From beju_gaby at yahoo.com Thu Oct 27 15:55:56 2016 From: beju_gaby at yahoo.com (Gabzela) Date: Thu, 27 Oct 2016 06:55:56 -0700 (PDT) Subject: [datatable-help] Loading long CSV tables in R Message-ID: <1477576556428-4726016.post@n4.nabble.com> Hello. I am a student trying to make some statistical analysis with some daily discharge time series for several hydrometric stations. I have organized all the discharge values of the stations (with daily discharge for 10-50 years, upon the station) on one Excel sheet (each line has a daily value in column D, corresponding to the date specified in column C, for a certain station whose name is in column B and river in column A). Then, I save that sheet with all my data in a csv format In R, I tried to load the table with read.csv , but I receive this error message: [ reached getOption("max.print") -- omitted 1015467 rows ] If this length of the data is not enough for R, how else I could organize my stations, so that I can do the statistics for all of them at the same time, without creating for each of them a separate CSV file? Thank you so much! -- View this message in context: http://r.789695.n4.nabble.com/Loading-long-CSV-tables-in-R-tp4726016.html Sent from the datatable-help mailing list archive at Nabble.com. From mithra.chintha at uconn.edu Thu Oct 27 16:02:21 2016 From: mithra.chintha at uconn.edu (Chintha Mithra) Date: Thu, 27 Oct 2016 07:02:21 -0700 (PDT) Subject: [datatable-help] Loading long CSV tables in R In-Reply-To: <1477576556428-4726016.post@n4.nabble.com> References: <1477576556428-4726016.post@n4.nabble.com> Message-ID: <1477576941782-4726017.post@n4.nabble.com> Hi Gabzela, R console has a limit of printing the rows present in the table. Use View([dataframeName]) to look through all the rows uploaded to R environment. Regards, Mithra -- View this message in context: http://r.789695.n4.nabble.com/Loading-long-CSV-tables-in-R-tp4726016p4726017.html Sent from the datatable-help mailing list archive at Nabble.com. From nfields at gmail.com Thu Oct 27 16:54:53 2016 From: nfields at gmail.com (affableambler) Date: Thu, 27 Oct 2016 07:54:53 -0700 (PDT) Subject: [datatable-help] Loading long CSV tables in R In-Reply-To: <1477576556428-4726016.post@n4.nabble.com> References: <1477576556428-4726016.post@n4.nabble.com> Message-ID: <1477580093576-4726018.post@n4.nabble.com> All of your data should be loaded. The size of a dataframe that can be loaded into R is only limited by the amount of memory in your computer. There is a limit to the number of rows of data can be printed to the console at one time, but rest assured that whatever statistical analysis you perform will be run on the entire dataset. -- View this message in context: http://r.789695.n4.nabble.com/Loading-long-CSV-tables-in-R-tp4726016p4726018.html Sent from the datatable-help mailing list archive at Nabble.com. From beju_gaby at yahoo.com Fri Oct 28 09:53:10 2016 From: beju_gaby at yahoo.com (Gabzela) Date: Fri, 28 Oct 2016 00:53:10 -0700 (PDT) Subject: [datatable-help] Loading long CSV tables in R In-Reply-To: <1477576941782-4726017.post@n4.nabble.com> References: <1477576556428-4726016.post@n4.nabble.com> <1477576941782-4726017.post@n4.nabble.com> Message-ID: <1477641190121-4726033.post@n4.nabble.com> Hello. Thank you so much. So, basically, what I have to do is to load the csv table, as usual, and see it with View([dataframeName]) But for other purposes, like doing statistics with all the dataframe, it should work even if I cannot see all the table in R because of limited memory for the data that can be printed to the console at one time -- View this message in context: http://r.789695.n4.nabble.com/Loading-long-CSV-tables-in-R-tp4726016p4726033.html Sent from the datatable-help mailing list archive at Nabble.com. From stefac88 at gmail.com Fri Oct 28 10:58:49 2016 From: stefac88 at gmail.com (Wolf359) Date: Fri, 28 Oct 2016 01:58:49 -0700 (PDT) Subject: [datatable-help] Problem with creation of netcdf file Message-ID: <1477645129216-4726034.post@n4.nabble.com> Hello everyone! I have a weird problem with the netcdf format: I want to save part of the lon-lat matrix "radar_ok_final" as .nc file, so I select the first 271 columns (corrensponding to the first 271 values in the longitude vector "Longvector") and I get this plot from the netcdf file that I create: But if I select only the first 270 columns (and of course I modify "Longvector" in Longvector = lon_new_mosaico[c(1:270)]) I get this strange plot, translated and distorted, instead of the same plot above without the last column of data. Why? here is my code:# dataradar_ok_final <- radarok_mosaico[,c(1:271)] # then I change to c(1:270)# write the ncdf filesLongvector = lon_new_mosaico[c(1:271)] # then I change to c(1:270)Latvector = lat_new_mosaico# Define the dimensionsdimX = ncdim_def("Long", "degreesE", Longvector)dimY = ncdim_def("Lat", "degreesN", Latvector)# Define missing valuemv = NA# Define the datavar2d = ncvar_def("dBZ", "units", list(dimX,dimY), mv, prec="double", compression=9)# Create the NetCDF file# If you want a NetCDF4 file, explicitly add force_v4=Tnc = nc_create(paste("/home/radarmeteo.com/data_archive/",year, month, day,"/Mosaico/Radar_mosaico_",year, month, day,"_",hour, minutes1,".nc", sep=""), list(var2d), force_v4=T)# Write data to the NetCDF filencvar_put(nc, var2d, matrix(radar_ok_final, nrow=length(Latvector), ncol=length(Longvector)))# Close your new file to finish writingnc_close(nc)Thank you very much for the help! -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-creation-of-netcdf-file-tp4726034.html Sent from the datatable-help mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfields at gmail.com Fri Oct 28 15:47:07 2016 From: nfields at gmail.com (affableambler) Date: Fri, 28 Oct 2016 06:47:07 -0700 (PDT) Subject: [datatable-help] Loading long CSV tables in R In-Reply-To: <1477641190121-4726033.post@n4.nabble.com> References: <1477576556428-4726016.post@n4.nabble.com> <1477576941782-4726017.post@n4.nabble.com> <1477641190121-4726033.post@n4.nabble.com> Message-ID: <1477662427315-4726042.post@n4.nabble.com> Thank you so much. So, basically, what I have to do is to load the csv table, as usual, and see it with View([dataframeName]) But for other purposes, like doing statistics with all the dataframe, it should work even if I cannot see all the table in R because of limited memory for the data that can be printed to the console at one time By using View(), you will be able to see the entire data frame in neatly separated rows and columns, similar to viewing an excel spreadsheet. Everything else you said is correct. -- View this message in context: http://r.789695.n4.nabble.com/Loading-long-CSV-tables-in-R-tp4726016p4726042.html Sent from the datatable-help mailing list archive at Nabble.com. From beju_gaby at yahoo.com Fri Oct 28 16:11:40 2016 From: beju_gaby at yahoo.com (Gabzela) Date: Fri, 28 Oct 2016 07:11:40 -0700 (PDT) Subject: [datatable-help] Loading long CSV tables in R In-Reply-To: <1477662427315-4726042.post@n4.nabble.com> References: <1477576556428-4726016.post@n4.nabble.com> <1477576941782-4726017.post@n4.nabble.com> <1477641190121-4726033.post@n4.nabble.com> <1477662427315-4726042.post@n4.nabble.com> Message-ID: <1477663900817-4726044.post@n4.nabble.com> Thanks a lot! Now I have another problem with making it calculating the statistics for every station. My table has 4 columns: River, Station, Date and Value of discharge. You can imagine, according to the length of the data series for each station, I have thousands of rows for each station (the River and Station columns vary quite a little, only when it passes to another station). But for a given River and Station, whose names repeat every row, the date (days) and values always differ. And what I want R to calculate is the multiannual statistics for every station following each other on the vertical. What command I should use so that it calculates the statistics from the column "Value of Discharge", based on the name of the station from the 2nd column? Thank you! -- View this message in context: http://r.789695.n4.nabble.com/Loading-long-CSV-tables-in-R-tp4726016p4726044.html Sent from the datatable-help mailing list archive at Nabble.com. From szabolcs_pal at yahoo.co.uk Sat Oct 29 14:57:37 2016 From: szabolcs_pal at yahoo.co.uk (bowlinggolyo) Date: Sat, 29 Oct 2016 05:57:37 -0700 (PDT) Subject: [datatable-help] Specify my data as working dataset Message-ID: <1477745857630-4726059.post@n4.nabble.com> I am a newbie to R. I can successfully load mydata into R-Studio, and I can see mydata in the workspace. However, when I run data(mydata1) I get the following warning message: In data(mydata1) : data set ?mydata1? not found I need to run the data() command as recommended in the evReturn() command, which is part of the erer package. The code: library ("gdata") library("zoo") library('quantmod') library("lmtest") library("erer") mydata1 <- read.csv("ndx.csv",header=TRUE, sep=";") data(mydata1) What can I do to solve this problem? Tanks you for your help. Szabi -- View this message in context: http://r.789695.n4.nabble.com/Specify-my-data-as-working-dataset-tp4726059.html Sent from the datatable-help mailing list archive at Nabble.com. From J.Gorecki at wit.edu.pl Sat Oct 29 16:26:29 2016 From: J.Gorecki at wit.edu.pl (Jan Gorecki) Date: Sat, 29 Oct 2016 15:26:29 +0100 Subject: [datatable-help] Specify my data as working dataset In-Reply-To: <1477745857630-4726059.post@n4.nabble.com> References: <1477745857630-4726059.post@n4.nabble.com> Message-ID: Hi Szabi, "data" is probably not the function you are looking for. If you have troubles with any R function just type it with question mark "?data" to display manual. Start your R journey from R manuals, especially examples at the bottom of manual pages. In case of future questions be aware datatable-help mailing list is not R-help mailing list, but mailing list related to data.table R package. Regards, Jan On 29 October 2016 at 13:57, bowlinggolyo wrote: > I am a newbie to R. > > I can successfully load mydata into R-Studio, and I can see mydata in the > workspace. > > However, when I run data(mydata1) > > I get the following warning message: In data(mydata1) : data set ?mydata1? > not found > > I need to run the data() command as recommended in the evReturn() command, > which is part of the erer package. > > The code: > > library ("gdata") > library("zoo") > library('quantmod') > library("lmtest") > library("erer") > > mydata1 <- read.csv("ndx.csv",header=TRUE, sep=";") > > data(mydata1) > > > What can I do to solve this problem? > > Tanks you for your help. > Szabi > > > > -- > View this message in context: http://r.789695.n4.nabble.com/ > Specify-my-data-as-working-dataset-tp4726059.html > Sent from the datatable-help mailing list archive at Nabble.com. > _______________________________________________ > datatable-help mailing list > datatable-help at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/ > listinfo/datatable-help -------------- next part -------------- An HTML attachment was scrubbed... URL: From quique_3716 at hotmail.com Mon Oct 31 20:02:18 2016 From: quique_3716 at hotmail.com (quique3716) Date: Mon, 31 Oct 2016 12:02:18 -0700 (PDT) Subject: [datatable-help] How to calculate the minimum standard deviation? Message-ID: <1477940538399-4726102.post@n4.nabble.com> Dear users, Given the vectors A and B, A = c(8692,8654,8758,8813,8637,8381,8428,8501,8321,8033) B = c(4,3.896,3.906,3.859,3.707,3.52,3.595,3.719,3.648,3.47) How can I find the value of number n that gives the minimum standard deviation value according to: sd(A-n*B) Thank you very much in advance -- View this message in context: http://r.789695.n4.nabble.com/How-to-calculate-the-minimum-standard-deviation-tp4726102.html Sent from the datatable-help mailing list archive at Nabble.com.