similar to: pipe

Displaying 20 results from an estimated 40000 matches similar to: "pipe"

2002 Nov 22
2
Need help with pipe()
Hello. I have an R program that calls gawk (GNU Awk 3.06 for Windows) from within pipe() to preprocess a large file before it is read into a data frame with read.table(). I've recently upgraded from Win98SE to WinXP, and have also upgraded from R1.5.0 to R1.6.1 over the past month or so. This program worked before the upgrade(s), but now fails. I observe the following sort of behavior with
2011 Jan 21
1
Reading gz compressed csv file - 'incomplete line found'
Hi all, I am trying to download, decompress and read a csv file. My code: myurl <- "ftp://ftp.ncbi.nih.gov/pub/geo/DATA/supplementary/series/GSE24729/GSE24729_MitoNuclear_suppl_male_stats.csv.gz" # myfile <- "GSE24729_MitoNuclear_suppl_male_stats.csv.gz" # download.file(myurl, destfile=myfile, mode="w") # mycon <- gzcon(gzfile(myfile,
2007 Apr 30
3
Read every second line from ASCII file
Dear all, I have an ASCII file where records are separated by a blank. I would like to read those data; however, only the data in rows 1, 3, 5, 7, ... are important; the other lines (2,4,6,8,....) contain no useful information for me. So far I used awk/gawk to do it: gawk '{if ((FNR % 2) != 0) {print $0}}' infile.txt > outfile.txt What is the recommended way to accomplish this in R?
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
2010 Apr 07
1
specifying header in sqldf() and RSQLite
I have a file that I'm planning on manipulating with sqldf(). The header for this file is malformed, and I was wondering if there's a way to specify the values of the header ahead of time. I can see there are T/F options for header in sqldf(... list(header=T, ...), but was wondering if there's a way to explicitly stated what the header should be. Thanks, Andrew [[alternative HTML
2006 Nov 29
3
comma delimiter & comma in text
Hi I have data like 1, A, 24, The Red House 2, A, 25, King's Home, by the Sea ... I'd like to read this in as three variables. I first tried temp <-read.csv(addresses, sep = "," ) it worked but line 2 was broken after King's Home, and by the Sea as placed in another line. and so i eneded up with more number of rows than in the data. when i tried temp
2003 May 20
1
R in BATCH mode
Dear all, In R<=1.6.2 I usually used the following code (in DOS prompt) to run R in batch mode C:\documents> Rcmd BATCH myfile.R and I could see the results (including warning messages) in the file myfile.Rout In R.1.7.0 I'm experiencing the followings: (1) even if I type "Rcmd BATCH myfile.R myfile.Rout", no file myfile.Rout is created, but just a "&1" file
2009 May 09
5
Reading large files quickly
I'm finding that readLines() and read.fwf() take nearly two hours to work through a 3.5 GB file, even when reading in large (100 MB) chunks. The unix command wc by contrast processes the same file in three minutes. Is there a faster way to read files in R? Thanks!
2013 Dec 09
2
How can I find nonstandard or control characters in a large file?
I have a humongous csv file containing census data, far too big to read into RAM. I have been trying to extract individual columns from this file using the colbycol package. This works for certain subsets of the columns, but not for others. I have not yet been able to precisely identify the problem columns, as there are 731 columns and running colbycol on the file on my old slow machine takes
2005 Jun 09
3
dir() and RegEx and gsub()
Dear R-Users, I have two questions: a) in a directory there are 3 files: [1] "Data.~csv" "Kopie von Data.~csv" "VorlageTradefile.csv" The command "dir( fold, pattern = "\.csv" )" gives back *all* the 3 files With dir( fold, pattern = "\\.csv" ) I get back only VorlageTradefile.csv. I don't understand this behaviour,
2006 Oct 13
2
loop, pipe connection, output objects
Hi all, I have the following -newbye- problem. Inside R, I am trying to process a file and creating from it many files. The file is organized in different columns, the second containing a code. I want to create as output objects, which contain only entries in a certain code range, and whose name contain the code itself. Here is my attempt indice <- (201:399) for(i in indice){ data.i <-
2012 Oct 24
4
Z score
Hi, I need to find the z-score of the data present in a speardsheet. The values needs to be calculated for each gene across the samples (refer the example). And, it should be a simple thing, but I am unable to do it right now ! The example re the structure of the spreadsheet is - # Example: MyFile <- read.csv( text= "Names,'Sample_1','Sample_2','Sample_3'
2008 Aug 25
2
Large Data Set Help
I am attempting to perform some simple data manipulation on a large data set. I have a snippet of the whole data set, and my small snippet is 2GB in CSV. Is there a way I can read my csv, select a few columns, and write it to an output file in real time? This is what I do right now to a small test file: data <- read.csv('data.csv', header = FALSE) data_filter <- data[c(1,3,4)]
2013 Jan 29
1
points rejected as lying outside the specified window
Hello, I am using the following code to create ppp files from csv data and map shape files, but I am getting some errors which I have been unable to fix by searching them online: library(spatstat) library(maps) library(maptools) NYC2<-readShapePoly("nybb.shp") # this is a map of the NYC boroughs without waterways and no census tract divisions (but it does include lines separating
2011 Oct 18
1
How to read data sequentially into R (line by line)?
I have a data set like this in one .txt file (cols separated by !): APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! it contains over 14 000 000 records. Now
2002 Mar 28
3
how to run .r batch file
I am completely new to R, but have some bg in cs and stat. since R has an interactive programming environment, I thought I could write my command in a file and run it in batch mode in the Rgui. but it didnt work. I checked the doc. it said Rcmd BATCH inputfile. it didnt work either. Can someone help? thank you. thank you. also if you can shed some light on passing command line arguements (like
2006 Jan 01
2
Wish list
This is my New Year wishlist for R features. One common thread is that I find I sometimes use languages other than R including javascript, Windows batch and gawk. Others have mentioned other languages too. It would be nice if, in those cases I could use R simplifying development into a single environment (viz. R). The following are not in any order. 1. Self Contained Executables Make it
2009 Dec 20
2
read.table: mysterious line omissions
Hello again, I am simply trying to import a rectangular table of strings. The table's dimensions are 1990 x 2, yet my read.table() command can only find 362 of the rows (and they're not the first 362). I would've taken the time to figure out how to use scan, readLines, or some other tool that can read in character strings, and then parse and input to a table, but that seems like
2010 Jul 02
2
Files with Missing Data
I'm a new R user so this is possibly a naive question. I'm trying to load an external CSV file into a dataframe using: df_name<-read.table("myfile.csv") myfile.csv should have 5 elements per row, though a percentage are missing the last two elements (the commas are present as placemarkers). However, R does not create the dataset but returns the message: line 1
2005 Mar 03
2
reading row vectors from file
Hi, New to R, using version 2.0.1 (2004-11-15) on debian Linux (sid), kernel 2.6.8-2-686. I have data in files with separate vectors on each row of the file, e.g., $ cat /tmp/stats freq,0,1,2,3,4,5,6,7,8,9,16,17,18,19,20,... noise,49,47,48,48,50,47,48,47,46,50,48,54,49,47,49,... signal,99,0,100,0,0,100,0,100,100,0,100,101,100,0,0,... pctrcv,5,0,5,0,0,5,0,5,11,0,5,5,5,0,0,...