similar to: how to skip from some null file and go on reading?

Displaying 20 results from an estimated 2000 matches similar to: "how to skip from some null file and go on reading?"

2012 Jun 12
1
how to skip out and go on read while the read.table meet with a null file
hi ,R users I read a series of file by the command shown as below. cop_x_data<-read.table(flnm,skip=2) the first two line of the files are headfile and I skip them. and sometimes the original data file is null and there is no any data in the file except for the head information. At this situation,my command would be in the error and tell me that there is not data in the file and can not go
2011 Sep 02
2
how to return back to go on my cycle while read my files
hi ,when i read a lots of files for (i in 1:totnum) { cop_x_data<-read.table(flnm[i],skip=2) if(i==1) {cop_data=cop_x_data} else {cop_data=rbind(cop_data,cop_x_data)} } some of the files are missing . so this loop can not go on .I wonder how can I go on the loop cycle while reading the files just like the command read(unit,err=linenum) in fortran ? thank you . -- TANG Jie [[alternative
2011 Sep 01
3
how to get the varifying character with two variables?
hi R user mtdno<-paste("data",1:3,sep="") tyno<-paste("obs",1:5,sep="") flnm<-paste(mtdno,tyno,"_err.dat",sep="") flnm is [1] "data1obs1_err.dat" "data2obs2_err.dat" "data3obs3_err.dat" [4] "data1obs4_err.dat" "data2obs5_err.dat" but actually what i want is data from 1 to 3
2011 Aug 25
2
how to read a group of files into one dataset?
for example : I have files with the name "ma01.dat","ma02.dat","ma03.dat","ma04.dat",I want to read the data in these files into one data.frame flnm<-paste("obs",101:114,"_err.dat",sep="") newdata<-read.table(flnm,skip=2) data<-(flnm,skip=2) but the data only contains data from the flnm[1] I also tried as below : for
2005 Jul 27
2
R 2.1.1: read.table processes C-style escapes (PR#8037)
In R 2.1.1, the default behaviour of scan() was changed to process all C-style escapes, even when a delimiter was specified using the 'sep' argument. A new argument 'allowEscapes' was introduced to turn this processing off. Because read.table() calls scan(), read.table() inherits the new default behaviour of scan() but without a way to turn it off. For example, reading a file
2010 Apr 08
1
Using read.table to read file created with read.table and qmethod = "escape"
df <- data.frame(a = "a\"b") write.table(df, "test.csv", sep = ",", row = F) Is there any to load test.csv into R correctly? I've tried the following: > read.table("test.csv", sep = ",") [1] V1 <0 rows> (or 0-length row.names) Warning message: In read.table("test.csv", sep = ",") : incomplete final line
2009 Jun 17
1
problem with scan recognizing newline '\n'
I'm using R to do some file processing in Linux and am trying to read in the output of find . -type f -print > ~/Music_Archives_search_problem/ls.output.find.txt This command yields a text file with each line representing the full path name of all files in the directory and subdirs. Unfortunately, there seem to be some special characters that interfere with scan recognizing '\n' as
2011 Dec 08
2
read.table question
Hello All, This works, results <- read.table("plink.txt",T) while this doesn't. results <- read.table("plink.txt") Make sure your data frame contains columns CHR, BP, and P What does adding the "T" in read.table do? Which argument does this correspond to? I tried searching for it but didn't find the answer in: read.table(file, header = FALSE,
2010 Jan 11
2
Documentation: format of read.table help text (PR#14180)
Dear R developers, I find the format of descriptions of the arguments in the read.table help text slightly inconsistent. For example, the logical arguments comes in seven different formats, more or less explicit about the consequences of a TRUE (or FALSE): 1. check.names logical. If TRUE then the names... 2. blank.lines.skip logical: if TRUE blank lines... 3. flush logical: if TRUE,
2012 Mar 08
6
how to modify the tickment of x-axis
hi I plot a series of observation data every minutes in a day as the attachment below plot(wnd,type='l',lty=1,col='red',lwd=1,xlab=xxlab,ylab=yylab,ylim=YY) In the figure, the x-axis tickment is the number of data How can I change it fore example 1h 2h 3h 4h and so on ? -- TANG Jie Email: totangjie at gmail.com Tel: 0086-2154896104 Shanghai Typhoon Institute,China
2009 Mar 02
2
R-code help for filtering with for loop
Dear Sir / Madam, I am new for R coding. Kindly help me out in sorting out the following problem. There are 50 rows with six coloumns(you could see in the attached .txt file). I wish to go for filtering this 50 rows for any one of the six coloumns satisfying the value >= 64. I need to have a final table with rows having >= 64 value in any one of the six coloumns and the rest could be
2009 Jul 29
2
quetions about dimensions
hi ,everyone, I have a script shown as below: > bj2=bjerrdata$tyerr[bjyearnum[2]+1:bjyearnum[3]] > length(bj2) [1] 448 while > b=bjyearnum[3] > a=bjyearnum[2]+1 > bj1=bjerrdata$tyerr[a:b] > length(bj1) [1] 169 it is different with bj2 and bj1 . and the array bjyearnum is [1] 0 279 448 633 1021 1365 1813 2237 2839 3314 3798 4157 12 why bj1 is 169 while bj2 is 448
2010 May 19
1
apparent problems with the textConnection command
Dear list, In my experiments in reading in text data, I have?obtained some peculiar results.?I would appreciate any help in understanding these results. Consider the following code : ## Reading in text data from a text file ### the first line of file f1.txt contains the text :??? c:\Rtools\bin;c:\Rtools\perl\bin;c:\Rtools\MinGW\bin; f1<-file("C:\\Ex\\f1.txt") c1<-readLines(f1,1)
2012 Mar 14
6
where I can find more color names or color definition?
hi everyone . Now I want to draw several lines in one frame.And it seems needs more colors except for blue red,black .Where can i found these color name or define some new color ?thank you . -- TANG Jie Email: totangjie@gmail.com Tel: 0086-2154896104 Shanghai Typhoon Institute,China [[alternative HTML version deleted]]
2009 Nov 24
1
Encoding problems.
Hello, I use: R version 2.9.2 (2009-08-24) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 on Ubuntu 9.10, I usually run R from ESS (5.4 on current Unbuntu) from Emacs-22.2.1. But I also tried the following from the console and it gave the same results. I have a data file containing lots of European characters, French, German, Italian and so on. I can read it
2012 Jul 10
2
is it possible to insert a figure into into another new figure by r script
hi R-users Now I have a figure in emf or png or tiff format that have been drawn by other tool and I want to insert this figure into my new figure by R script. I wonder if is possible ? -- TANG Jie Email: totangjie@gmail.com Tel: 0086-2154896104 Shanghai Typhoon Institute,China [[alternative HTML version deleted]]
2006 Aug 16
6
read.csv issue
I'm trying to read in some data from a .csv format and have come across the following issue. Here is a simple example for replication # A sample .csv format schid,sch_name 331-802-7081,School One 464-551-7357,School Two 388-517-7627,School Three \& Four 388-517-4394,School Five Note the third line includes the \ character. However, when I read the data in I get >
2011 Nov 17
2
how to read a freetext line ?
hi everyone . Here I have a text where there are some integer and string variables.But I can not read them by readLines and scan the text is : weight ;30;130 food:2;1;12 color:white;black the first column is the names of the variables and others are the value of them. the column in different line are different. Can anyone help me ? -- TANG Jie Email: totangjie@gmail.com Tel: 0086-2154896104
2012 Aug 01
2
how to subset the data frame by lines
I defined a data.frame by a two-dimensional array. > aa = data.frame(rbind( 11:20, 1:10)) > aa X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 11 12 13 14 15 16 17 18 19 20 2 1 2 3 4 5 6 7 8 9 10 Now I want to use the data in the second line of aa which from 1 to 10 to output.But I find that when I use the aa[[1]][1:10] and it seems be mistake. aa[[1]][1:10] [1] 11 1 NA NA NA
2009 Jul 18
3
how to run the R script in background in Windows XP?
Hello ,everyone. I am a fresh user of R. I wrote several several R script in R with the version 2.9.1 in Windows XP. But I only can run these scrpit via R-GUI. Can anyone tell me how to run the scripts in background without openning R-gui.In another word, run the R-script and get the result via some batch proceesing files or shell scripts directly? Thanks. . -- TANG Jie Email: