similar to: automatic file input

Displaying 20 results from an estimated 6000 matches similar to: "automatic file input"

2011 Jul 14
5
Adding rows based on column value
Dear all, I have one problem and did not find any solution.(I have also attached the problem in text file because sometimes column spacing is not good in mail) I have a file(file.txt) attached with this mail.I am reading it using this code to make a data frame (file)- file=read.table("file.txt",fill=T,colClasses = "character",header=T) file looks like this- Chr Pos
2011 Jul 21
2
User input(unknown name and number of files)
Dear all, I need your help as I was not able to find out the solution. The thing is- I am having a code which is reading file with this code- df=read.table("Case2.pileup",fill=T,sep="\t",colClasses="character") but as am making a tool so that user can use it and can do analysis on his file.But the name of the file will not be Case2.pileup and I want to use this
2011 Jul 05
3
Output data frame using write.table
Dear all, I have a data frame whose name is m1. I want to write this data frame in text file as output.I am using this code- write.table(m1, file = "kas.txt", append = FALSE,row.names=F,quote=F,sep="\t") When I am opening my kas.txt file,the column names are not coming exactly above the column. What should I do.Please help me. Thanking you, Warm Regards Vikas Bansal Msc
2011 Jul 01
13
For help in R coding
Dear all, I am doing a project on variant calling using R.I am working on pileup file.There are 10 columns in my data frame and I want to count the number of A,C,G and T in each row for column 9.example of column 9 is given below- .a,g,, .t,t,, .,c,c, .,a,,, .,t,t,t .c,,g,^!. .g,ggg.^!, .$,,,,,.,
2011 Aug 07
3
Printing data frame with million rows
Dear all, I was working on number of files and at the end I got a data frame with approx. million rows.To prin this data frame in output, I used capture.output(print.data.frame(end,row.names=F), file = "summary", append = FALSE) where end is the name of my data frame and summary is the name of my output file. but when I checked the output there were only 10000 rows and at the last it
2011 Aug 07
1
Removing funny characters from a column of a data frame
Dear all, The 5th column of my data frame is like this- .$.$.$.$.$,$,$...,,,,,.,,.,,...,,,,.,,....,,,T...,,,,,,,,,,,.,,,,,....,,...,, ,..,,....,,,,,...,,,..,,......,,,,,,,....,,,.,,,,....,,...G.,,,,,,,,...,,,,,,.,, ,t.,,c,,.a.,,,.A,,,,....,,,.....,,,,..........,,,,,..,,,.,,,....,,,,,...,,,$.... .,,,,..,,,...,,,,,..,,,,,,.............$..,,,,,,...,,..,,$,...,,,,,,,....,,,,,,.
2011 Jul 24
2
Deleting rows and store the deleted rows in new data frame
Dear all, I am using grep but I did not understand the problem as I am doing something wrong.Please help me. I am using this code- sf=data.frame(sapply(df[],function(x) grep('\\.&\\,', df[,9]))) the thing is i have a data frame(df) like this- 10 135349467 g G 4 0 0 5 ,,,., 10 135349468 t T 2 0 0 5 ,,c., 10 135349469 g G 7 0 0 5 ,,a., 10 135349470 c C 8 0 0 5 ,,,., 10 135349471
2011 Oct 31
3
Plot two matrices and keeping the record of row names
Dear all, I have two data frames- x1 and y1 with same row names and column names(actually the names of the patients). x1 a b c d e a 1.0000000 0.4730679 0.6226994 0.6036036 0.6433333 b 0.4730679 1.0000000 0.6227273 0.6303855 0.5730858 c 0.6226994 0.6227273 1.0000000 0.7290503 0.6900585 d 0.6036036 0.6303855 0.7290503 1.0000000
2018 Feb 15
2
writeLines argument useBytes = TRUE still making conversions
On Thu, Feb 15, 2018 at 11:19 AM, Kevin Ushey <kevinushey at gmail.com> wrote: > I suspect your UTF-8 string is being stripped of its encoding before > write, and so assumed to be in the system native encoding, and then > re-encoded as UTF-8 when written to the file. You can see something > similar with: > > > tmp <- '?' > > tmp <- iconv(tmp,
2011 Aug 01
1
Inserting column in between -- "better" way?
Folks: I consider my reply below rather clumsy: One has to keep track of index numbers other than that which is inserted and must separately change column names. Is there as "essentially better" way to do this, either via base R or via an R package. I leave it to you to define "essentially better." Thanks. Cheers, Bert On Mon, Aug 1, 2011 at 10:17 AM, Bert Gunter
2018 Feb 17
1
writeLines argument useBytes = TRUE still making conversions
Of course, right after writing this e-mail I tested on my Windows machine and did not see what I expected: > charToRaw(before) [1] c3 a9 > charToRaw(after) [1] e9 so obviously I'm misunderstanding something as well. Best, Kevin On Sat, Feb 17, 2018 at 2:19 PM, Kevin Ushey <kevinushey at gmail.com> wrote: > From my understanding, translation is implied in this line of ?file
2011 Jul 13
1
Error non-numeric argument to binary operator
Dear all, I have a data frame df and i am using a code shown below. df[, "total"] <- rowSums(df[, 3:6]) MAKING A NEW COLUMN total in df BY ROWSUMS defineSamples<- function() { readline("enter the number of INDIVIDUALS IN POOL: ") } df$ind=definesamples() CALLING THE FUNCTION AND STORING THE INPUT FROM USER IN NEW COLUMN OF df df[, 3:6] <-
2011 Jul 25
4
ggplot question: changing the label for the Y axis on a histogram
Some help with how to re-label the vertical axis in a histogram would be appreciated. qplot(off.sc,weight=rel.freq,binwidth=.29,main="test Figure"+ylab("New from inside"))+ylab("New from outside")+ xlab("off.sc\nAggregated frequency plots for 17 equal intervals.") The code
2010 Sep 05
4
converting string vector to integer/numeric vector
Hi, Is it possible to convert a string vector to integer or numeric vector? In my situation I receive data in a string vector and have to convert it based on a given type. -- Rajesh.J [[alternative HTML version deleted]]
2007 Oct 25
2
Novice programing question
Hi all, I apologize for the ignorance implicit in this question, but I'm having a hard time figuring out how R functions work. For example, if I wanted to write a function to compute a variance, I would do something like >my.var <- function(x) (sum(((x-mean(x)))^2))/(length(((x-mean(x))) ^2)-1) And this seems to work, e.g., > my.var(V1) [1] 116.1 > var(V1) [1] 116.1
2017 Aug 23
3
Getting all possible combinations
ummm, Ista, it's 2^n. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Aug 23, 2017 at 8:52 AM, Ista Zahn <istazahn at gmail.com> wrote: > On Wed, Aug 23, 2017 at 11:33 AM, Christofer Bogaso >
2012 Jan 03
2
Comparison of numeric and character vectors
Hi all, I just discovered that R considers characters to be really big: > "a" > 999 [1] TRUE > "a" > 9e307 [1] TRUE > "a" > 9e308 [1] FALSE and that some characters are literally infinitely big: > "Z" >= Inf [1] TRUE although not all: > "a" > Inf [1] FALSE This came as a surprise to me (although it is quite
2017 Jul 06
3
Efficient swapping
Thanks a lot, Ista! I really appreciate it. How about a slightly different case as the following: set.seed(1) (tmp <- data.frame(x = 1:10, R1 = sample(LETTERS[1:5], 10, replace = TRUE), R2 = sample(LETTERS[2:6], 10, replace = TRUE))) x R1 R2 1 C B 2 B B 3 C E 4 E C 5 E B 6 D E 7 E E 8 D F 9 C D 10 A E Notice that the factor levels between
2017 Aug 23
0
Getting all possible combinations
On Wed, Aug 23, 2017 at 12:35 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > ummm, Ista, it's 2^n. ummm yes ughhhh. My point is, if the number of groups is large, check it before hand. If you can check it without embarrassing yourself in public like I did that's even better. Best, Ista > > Cheers, > Bert > > > Bert Gunter > > "The trouble
2017 Aug 23
2
Getting all possible combinations
> On 23 Aug 2017, at 20:51 , Ista Zahn <istazahn at gmail.com> wrote: > > On Wed, Aug 23, 2017 at 12:35 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: >> ummm, Ista, it's 2^n. > > ummm yes ughhhh. > You didn't really say otherwise: sum(choose(n,0:n)) == 2^n by the binomial expansion of (1+1)^n (but you knew that) This points to a different