Displaying 20 results from an estimated 4000 matches similar to: "add data to a file while doing a loop"
2012 Sep 12
1
SNPRelate package error
Dear all,
I am using the R package SNPRelate but I found an error when I run the following command. Do you know what might be the problem? Thanks in advance.
> vcf.fn <- system.file("extdata", "sequence.vcf", package="SNPRelate")
> snpgdsVCF2GDS(vcf.fn, "test.gds")
Start snpgdsVCF2GDS ...
Open
2007 Jul 20
3
binned column in a data.frame
Dear all,
I would like to know how can I create a binned column in a data.frame. The output that I would like is something like this:
Start Binned_Start
1 0-5
2 0-5
6 5-10
8 5-10
13 10-15
...
Best regards
João Fadista
Ph.d. student
UNIVERSITY OF AARHUS
Faculty of Agricultural Sciences
Dept. of Genetics and Biotechnology
Blichers
2007 Jul 18
2
remove columns having a partial match name
Dear all,
I would like to know how can I retrieve a data.frame without the columns that have a partial match name. Let´s say that I have a data.frame with 200 columns and 100 of them have the name "StartX", with X being the unique part for each column name. I want to delete all columns that have the name starting with "Start". I´ve tried to do this but it doesn´t work:
>
2008 Apr 08
4
permutation test assumption?
Dear all,
Can I do a permutation test if the number of individuals in one group is much bigger than in the other group? I searched the literature but I didin´t find any assumption that refers to this subject for permutation tests.
Best regards
João Fadista
Ph.d. student
UNIVERSITY OF AARHUS
Faculty of Agricultural Sciences
Dept. of Genetics and Biotechnology
Blichers Allé 20, P.O.
2007 Jun 28
4
compare 2 vectors
Dear all,
I would like to take out the values from one vector that are equal to the values in another vector.
Example:
a <- c(1,2,3,4,5,6,7,8,9)
b <- c(3,10,20,5,6)
b_noRepeats = c(10,20)
So I would like to have the vector b without the same values as vector a.
Kind regards,
João Fadista
[[alternative HTML version deleted]]
2007 Mar 23
2
concatenate 2 data.frames
Dear all,
I would like to know how can I concatenate 2 data.frames into a single one. Both data frames have the same number of columns and the same class type in each correspondent column. So what I want is to have a new data.frame where I have first the values from one data.frame and then the values from a second data.frame would came after in this new data.frame.
Thanks in advance.
Med
2007 Sep 05
6
length of a string
Dear all,
I would like to know how can I compute the length of a string in a dataframe. Example:
SEQUENCE ID
TGCTCCCATCTCCACGG HR04FS000000645
ACTGAACTCCCATCTCCAAT HR00000595847847
I would like to know how to compute the length of each SEQUENCE.
Best regards,
João Fadista
[[alternative HTML version deleted]]
2011 Aug 31
3
subsetting by rows
Dear all,
I would like to know how to subset a data.frame by rows.
Example:
Probesets 34884 34888 34892
1 100009676_at A A A
2 10001_at P P P
3 10002_at A A A
4 10003_at A A
2011 Sep 02
3
merge some columns
Dear all,
I would like to know how to merge columns like:
Input file:
V1 V2 V3 V4 V5 V6
1 G A G G G G
2 A A G A A G
Desired output file:
V1 V2 V3
1 G/A G/G G/G
2 A/A G/A A/G
So for every 2 consecutive columns merge their content into one.
Thanks in advance.
[[alternative HTML version deleted]]
2007 Oct 10
1
subsetting a data.frame
Dear all,
I would like to be able to subset a data.frame in a special way. I will put here an example:
Score Name
88 000019_0070
88 000019_0070
87 000019_0070
79 002127_0658
79 002127_0658
77 002127_0658
So, for the above example I would like to have a new data.frame that has only the best "Score" for each
2007 Oct 31
1
find overlap between intervals
Dear all,
I would like to be able to know the intervals of my data that overlap between them. Here it goes a small example:
Input:
Start End
440 443
380 443
290 468
Desired output:
Start End
290 380
380 440
440 468
Best regards,
João Fadista
[[alternative HTML version deleted]]
2007 Oct 09
1
read only certain parts of a file
Dear all,
I would like to know how can I read a text file and create a data frame of only certain parts of the file.
For instance, from this text file:
===================================================
Matches For Query 0 (108 bases): 000019_0070
===================================================
Score Q_Name S_Name Q_Start Q_End S_Start S_End Direction Bases identity
89 000019_0070
2007 Sep 06
1
order intervals in a data.frame
Dear all,
I would like to know how can I order a data.frame with increasing the dat$Interval (dat$Interval is a factor). There is an example below.
Original data.frame:
> dat
Interval Number_reads
0-100 685
200-300 744
100-200 1082
2007 Oct 10
2
download.file not working
Hi all,
I'm trying to download a file from the net, and the download.file
command leaves it corrupted, i.e excel cannot open it. It seems as if
it's going ok, however.
Does anyone have an idea of what's going on?
regards,
Gustaf Rydevik
----
>download.file(url="http://www.who.int/entity/whosis/whostat2006_demographics.xls",destfile="whodem.xls")
trying URL
2007 May 30
2
runif with weights
Dear all,
I would like to generate 25 numbers from 1 to 100 but I would like to have some numbers that could be more probable to come out. I was thinking of the function runif:
runif(25, 1, 100) , but I don?t know how to give more weight to some numbers.
Example:
each number from 2 to 10 has the probability of 40% to come out but the probability of each number from 11 to 100 to come out is
2008 Jun 25
1
tiff() causes R to crash on WinXP (PR#11804)
Full_Name: Gustaf Rydevik
Version: 2.7.1
OS: Win XP professional
Submission from: (NULL) (130.237.97.254)
The following lines of code crash R 2.7.1 (=cause R to show "The R gui has
encountered a problem and needs to close"....). Replicated on two WinXp
professional machines, as well as by Uwe Ligges.
> sessionInfo()
R version 2.7.1 (2008-06-23)
i386-pc-mingw32
locale:
2009 Jul 21
1
Checking on closed file connections
Hi! I'm wondering if there's a smart way around this:
fileName= (some valid file on your system)
> fileCon=file(fileName, open="rt")
> l<-readLines (fileCon, n= 1)
>
> isOpen(fileCon)
[1] TRUE
> close(fileCon)
> isOpen(fileCon)
Error in isOpen(fileCon) : invalid connection
How do you test for a file being closed if isOpen gives you an error
2007 Sep 15
1
R-2.6.0 for Windows, semi-transparent colours and layout()
Hi,
The added support for semi-transparent colours in `windows' under
R-2.6.0 for Windows is much appreciated.
However, I've discovered that issuing a `layout' (or `par' with
arguments `mfcol'/`mfrow') call and then trying to plot several figures
with semi-transparent colour on the same page results in only the first
one being fully drawn. E.g.
> x <-
2007 Mar 30
1
Model comparison
Dear all,
I would like to know if I can compare by a significance test 2 models with different kind of parameters. Perhaps I am wrong but I think that we can only compare 2 models if one is a sub model of the other.
Med venlig hilsen / Regards
João Fadista
Ph.d. studerende / Ph.d. student
AARHUS UNIVERSITET / UNIVERSITY OF AARHUS
Det Jordbrugsvidenskabelige Fakultet / Faculty of
2012 Feb 12
3
Writing output into a file
Hi everyone,
I'm an R newbie working with the poLCA module. I achieved my target without
having to bother anyone, but It seems that I've got stuck at the last
minute.
My problem is simple. I need to write my results into a file.
My results are in the shape of a list (unbalanced columns)
I've considered several methods (sink(), write.file) etc. etc.
Unfortunately, I'm not the best