similar to: How to source a part of the file

Displaying 20 results from an estimated 20000 matches similar to: "How to source a part of the file"

2011 Mar 20
4
read file part way through based on start and end date (first column)
Hello folks - I have been trying to figure this out. I have a set of very large files that are of this format , , , , 1/4/1999,9:31:00 AM,blah, blah, blah 1/4/1999,9:32:00 AM,blah, blah, blah 1/4/1999,9:33:00 AM,blah, blah, blah I want to write R code that reads only that data between a start and an end date (data is presented from oldest at the top of the file to the most recent at the bottom
2012 Feb 02
9
sqldf for Very Large Tab Delimited Files
Hi All, I have a very (very) large tab-delimited text file without headers. There are only 8 columns and millions of rows. I want to make numerous pieces of this file by sub-setting it for individual stations. Station is given as in the first column. I am trying to learn and use sqldf package for this but am stuck in a couple of places. To simulate my requirement, I have taken iris dataset as an
2011 Sep 14
4
Reading large, non-tabular files
Dear R-help, I have a very large ascii data file, of which I only want to read in selected lines (e.g. on fourth of the lines); determining which lines depends on the lines content. So far, I have found two approaches for doing this in R; 1) Read the file line by line using a repeat-loop and save the result in a temporary file or a variable, and 2) Read the entire file and filter/reshape it using
2012 Dec 11
5
Retain last grouping after a strsplit()
All - I have a column of SiteNames: SiteName OYS-PIA2-FL-1 OYS-PIA2-LA-1 OYS-PI-LA-BB-1 OYS-PIA2-LA-10 ... [truncated] and I want to include only the last few digits into a new column. I tried substr(data$SiteName, 13, 20) but because some SiteName values are of a different length, the final hyphen (i.e., "-") was included: "1" "1" "-1" "10"
2011 Jan 24
3
error with source(): invalid 'times' value
hi I am seeing a strange behavior I can't understand... doing: > source("/tmp/RFile.r",echo=TRUE) Error in rep.int(c(prompt.echo, continue.echo), c(leading, length(dep) - : invalid 'times' value > traceback() 3: rep.int(c(prompt.echo, continue.echo), c(leading, length(dep) - leading)) 2: paste(rep.int(c(prompt.echo, continue.echo), c(leading, length(dep)
2011 Feb 13
3
String manipulation
Please consider following string: MyString <- "ABCFR34564IJVEOJC3434" Here you see that, there are 4 groups in above string. 1st and 3rd groups are for english letters and 2nd and 4th for numeric. Given a string, how can I separate out those 4 groups? Thanks for your time [[alternative HTML version deleted]]
2011 Nov 08
2
multi-line query
Hello, I'm using package RpgSQL. Is there a better way to create a multi-line query/character string? I'm looking for less to type and readability. This is not very readable for large queries: s <- 'create table r.BOD("id" int primary key,"name" varchar(12))' I write a lot of code, so I'm looking to type less than this, but it is more readable from
2012 Dec 03
5
xlsx file read in R
Dear all, How can I read .xlsx files in R Regards Nico [[alternative HTML version deleted]]
2011 Feb 04
3
Importing dates from SPSS file
Hello all, kind regards, I have imported a data.frame from SPSS using "foreign":read.spss but unfortunately it is reading dates in a way neither R nor myself can understand. > book$DATE [1] 13502246400 13443321600 13477795200 13472956800 13501728000 13445395200 13501382400 13502851200 13444185600 13461465600 13457232000 [12] 13458096000 13432435200 13431484800 13495334400
2013 Jan 09
2
writing to .xlsx
Dear r helpers; I'm interested in reading from and writing to large .xlsx files fairly regularly. (Why, the naysayers may ask - and the answer is basically colleagues and clients who prefer that format). I've tried out the XLConnect and xlsx libraries, but the java implementation they use just takes too much RAM for the files I'm working with. gdata leverages perl and works really
2010 Dec 29
2
How to create an array of lists of multiple components?
Hi, how can I create an array of lists of three components? This approach does not work: n1 <- 2 n2 <- 4 n3 <- 5 res <- array(rep(vector("list",3), n1*n2*n3), dim = c(n1,n2,n3)) res[1,1,1] # is not a list with three components... The goal is that res[1,1,1] is a list with three components. Also, appending the components didn't work. For example, I tried: component
2012 Feb 03
4
how to plot several curves in the same frame
Hello, I'd like to know how to plot several curves in the same frame (1curve = 1line=1day). For instance (csv file): 2012-02-01 01:00:00; 2100 2012-02-01 02:00:00; 2200 ... 2012-02-01 23:00:00; 2500 2012-02-02 01:00:00; 1000 2012-02-02 02:00:00; 1500 ... 2012-02-02 23:00:00; 1700 Here, I have to plot 2 curves in the same frame: 1 for 2012-02-01 (on the first line) and 1 for 2012-02-02 (on
2011 Oct 10
4
Type of Graph to use
Hi, Please advice on what type of graph can be used to display the following data set. I have the following: Name Class a Class 1 a Class4 b Class2 b Class1 d Class3 d Class5 e Class4 e Class2 So each entry in name can belong to more than one class. I want to represent the data as to see where
2011 Mar 11
3
'Date' elements within a matrix
Dear all, when I put date objects (class of 'Date') in a matrix it becomes numeric: > dat <- matrix(seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1 day"), 3) > dat [,1] [,2] [,3] [1,] 14975 14978 14981 [2,] 14976 14979 14982 [3,] 14977 14980 14983 > class(dat[1,1]) [1] "numeric" As it could not preserve the
2002 Dec 21
2
Part II Re: read.ssd {foreign} (Reading a permanent SAS d ataset into an R data frame)
>>>>> "Stephen" == Stephen Arthur <sarthur67 at yahoo.com> writes: Stephen> The SAS data set I PROC CPORTed is [9] the result is [10]. Stephen> I PROC CIMPORTed [10] back to its orginal state [9], and it Stephen> worked. Stephen> So the SAS people think that the error is not with the SAS Stephen> XPORT file, but with R trying to load a text
2012 Jul 11
2
Passing Multiple Variable Into SQLDF Statement as parameters of function
Hey guys, So I'm working with a project where I manage a database within R, and I'm developing a script/function that will automatically run my queries in R depending on the date parameters passed in. The problem is that when I create variables for the dates, and use those variables in my sqldf statements, R says that there is no such column in the dataframe (which is true!). My question
2012 Mar 18
2
Importing files
Hello, I'm trying to import into R files that contain data downloaded from logger devices as files with the following formats: .act .lig .trj .trn These files are essentially text files but use both tabs and commas as separators. I've tried the function scan: 1) scan("filename.act", what=character(0)) returns only two columns from the original 5 2) scan("copia.act",
2013 Feb 01
4
Filter according to the latest data
Hello together, i have a data.frame, like this one: No. Change Date A 123 final 2013-01-15 B 123 error 2013-01-16 C 123 bug fixed 2013-01-17 D 111 final 2013-01-12 and now a want a new data.frame which includes
2011 Mar 09
2
system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7
Hello, I work for a company in which a number of employees use R. Many of them like to run executables via the system function in such a way that the output of that executable is displayed in a separate window. To give an example of the behavior they require, the following command can be run in R GUI: system("cmd",invisible=FALSE,show.output.on.console=FALSE) The result is that a
2010 Dec 23
5
Writing a single output file
Dear R helpers! Let me first wish all of you "Merry Christmas and Very Happy New year 2011" "Christmas day is a day of Joy and Charity, May God make you rich in both" - Phillips Brooks ## ---------------------------------------------------------------------------------------------------------------------------- I have a process which generates number of outputs. The R code