similar to: (Edited) cbind alternate for data frames

Displaying 20 results from an estimated 2000 matches similar to: "(Edited) cbind alternate for data frames"

2012 Jan 06
6
cbind alternate
I have two one dimensional list of elements and want to perform cbind and then write into a file. The number of entries are more than a million in both lists. R is taking a lot of time performing this operation. Is there any alternate way to perform cbind? x = table1[1:1000000,1] y = table2[1:1000000,5] z = cbind(x,y) //hanging the machine write.table(z,'out.txt) -- -------------
2011 Jun 13
3
combine the data frames into comma separated list.
Hi R users, I am new to R and am trying to merge data frames in the following way. Suppose I have n data frames each with two fields. Field 1 is common among data frames but may have different entries. Field 2 is different. Data frame 1: Src Target1 1 aaa 1 bbb 1 ccc 2 aaa 3 ddd Data frame 2: Src Target2 2 aaaa 3 dddd 4 bbbb 4
2012 Jul 22
4
pvalue calculate
I have a value a=300 observation (x) = sample(1:50) How to find a p-value from this. I need to show that "a" is different fom mean(x). Thanks -- ------------- Mary Kindall Yorktown Heights, NY USA [[alternative HTML version deleted]]
2011 Aug 19
3
installing packages systemwide
I installed some downloaded packages in R. I always do $sudo R CMD INSTALL <anRpackage.tar.gz> By default it is storing these packages into my directory /home/mary/R/x86_64-pc-linux-gnu-library/2.13/. However I want them to be systemwide into /usr/local/lib/R/site-library/ folder. I tried $sudo R R> install.packages("anRpackage", dep=TRUE) I did not succeed into getting
2011 Aug 19
3
installing packages systemwide
I installed some downloaded packages in R. I always do $sudo R CMD INSTALL <anRpackage.tar.gz> By default it is storing these packages into my directory /home/mary/R/x86_64-pc-linux-gnu-library/2.13/. However I want them to be systemwide into /usr/local/lib/R/site-library/ folder. I tried $sudo R R> install.packages("anRpackage", dep=TRUE) I did not succeed into getting
2011 Nov 16
1
read.table : fill missing entry with "unAvailable" [edit]
Hi R users, I try to read a data file (tab delimited format) in which some of the entries in a particular field are missing. Is it possible to fill the unavailable data with 'UnAvailable' string while performing read.table() Something like df = read.table(DataFile, header=FALSE, fill_missing_entry = 'unAvailable') 1 thanks -- ------------- Mary Kindall Yorktown Heights,
2011 Dec 21
1
aggregate function
Hi I have a data frame with values in following format. param case1 1 a 2 b 2 c 2 d 3 e 4 f how to use aggregate so that it I only one row for each 'param' value. the output for the above input should be param case1 1 a 2 b,c,d 3 e 4 f Thanks M -- ------------- Mary
2012 Jan 08
1
mode of frequency distribution table
In a frequency distribution table (bell shaped), how can we find the most frequent range? for example: x = c(1,2, 4,4,4,4, 5,5,5,6,6,5,5,5,5,5,6,6,6,13, 17,17,30,100,300) barplot(table(x)) In the code above, which function do we use to find that the most frequent value range from 4 to 6. Thanks. -- ------------- Mary Kindall Yorktown Heights, NY USA [[alternative HTML version deleted]]
2011 Nov 08
2
download.file
I am downloading say 100 files from ucsc website and storing it into dest folder. download.file function create a file in destination folder even if the file is not present which is something I dont want. So I wrote if condition to remove the file if the download function has non zero value. Now it exits when there is an error or file not present. How can I use "try" and "if"
2011 Jun 14
1
[Resolved] combine the data frames into comma separated list.
Hi Thanks Gabor for your suggestion. I am posting the code that worked for me. dataframe1 = data.frame(cbind(Src = c(1,1,1,2,3), Target1 = c('aaa','bbb','ccc','aaa','ddd'))); #must be data frame dataframe2 = data.frame(cbind(Src = c(2,3,4,4,4), Target2 = c('aaaa','dddd','bbbb','eeee','ffff'))); dataframe3 =
2011 Sep 16
1
download files using ftp: avoid error
I am planning to download a large number of files from some website. I am using the following script. files2down = c('aaa', 'bbb', ................) for (i in 1: len) { print(paste('downloading file', i, ' of total ', len)); url = paste(urlPrefix, files2down[i], sep='') destfile = paste (dest, 'inDir', files2down[i], sep='/' )
2012 Jan 12
1
relative frequency plot using ggplot or other function
Hi I have a data frame in the following form. There are two groups and for each 'width' relative frequency for group1 and group2 is given. How to plot this in R using ggplot or other package. Width relativeFrequency1 relativeFrequency2 1 100 0.0006388783 0.02265428 2 200 0.0022677303 0.02948625 3 300 0.0061182673 0.01739936 4 400 0.0152237225 0.02569902 5 500
2011 Jun 19
1
save and load in R
I have a list of txt files that I want to convert into .rdata R data object. filenames 1. "./file1.txt" 2. "./file2.txt" 3. "./file3.txt" 4. "./file4.txt" 5. "./file5.txt" 6. "./file6.txt" 7. "./file7.txt" 8. "./file8.txt" 9. "./file9.txt" 10. "./file10.txt" I saved these files as for ( i in
2012 Jan 03
1
sqldf and not converting integers to floating point in SQLite
Hi, I have following 2 tables: Table 1: POSTAL | VALUE 1000|49 1010|100 1020|50 Table 2: INSEE | POSTAL A|1000 B|1000 C|1010 D|1020 I would like to convert this to the following: INSEE | VALUE_SPREAD A|24.5 B|24.5 C|100 D|50 I can achieve this with a nested SQL query (through counting the number of POSTAL that belong to any given INSEE, and diving the value of the postal in that INSEE by
2006 Feb 28
2
Need help with a Power Find()
I was hoping someone would be able to help me with creating a method. I have two tables. What I am trying to do is create a list of all the id''s from table2 that aren''t currently referenced by Table1''s address_id column. That way, when I create a new customer I can have a drop down list in the view of all the addresses that are not currently being used. ##### Database
2013 May 01
1
Combine multiple tables into one
Hi, May be this helps: dat1<- as.data.frame(table1) ?dat2<- as.data.frame(table2) names(dat2)<-c("V3","V4") library(plyr) res<-join(dat1,dat2,type="full") ?res[is.na(res)]<- 0 ?res #? V1 V2 V3 V4 #1? 1? 1? 0? 0 #2? 1? 2? 0? 0 #3? 0? 0? 0? 1 #4? 0? 0? 0? 4 ?combinedtable<-as.matrix(res) ?colnames(combinedtable)<- NULL ?combinedtable #???? [,1] [,2]
2006 Feb 19
1
One Model from two Tables with no foreign keys
I would like to create a model that is based on two database tables: Table1 --------- id (PK) data1 Table2 ---------- id (PK) data2 There is a one-to-one relationship between the records of Table1 and Table2. (That is, for every record in Table1 there is a record with matching id in Table2 and vice versa). The problem is that I cannot alter the table schemas in any way, so I cannot add
2006 Feb 21
1
[Bug 452] New: DNAT to internal network don't work with source routing and 2 uplinks
https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=452 Summary: DNAT to internal network don't work with source routing and 2 uplinks Product: netfilter/iptables Version: linux-2.6.x Platform: i386 OS/Version: Debian GNU/Linux Status: NEW Severity: normal Priority: P2
2011 Mar 10
1
snp-chip table
Dear R helpers I have a table and i need to make new table table1: sire snp1 snp2 snp3 snp4 snp5 snp6 snp7 snp8 snp9 snp10 snp11 snp12 snp13 snp14 snp15 8877 -1 -1 -1 -1 0 0 -1 -1 -1 0 1 1 1 -1 -1 7765 1 1 1 0 0 0 -1 1 1 1 0 0 0 1 0 8766 1 1 -1 0 -1 -1 0 -1 0 -1 -1 -1 0 1 0 6756 0 1 0 -1 1 -1 -1 0 0 0 0 -1 0 1 1 5644 -1 0 1 -1 0 0 0 0 -1 -1 0 0 0 0 1 I have table2 sire
2006 Mar 05
1
Sweave and long strings
Dear R-List, I use Sweave (which is wonderful) and I have a problem with the strings when they are too long according to the width of the page. For example when I do in my .Rnw document : <<UsingRODBC,echo=TRUE>>= channel <- odbcConnect(dsn="database",uid="root",pwd="password") df1 <- sqlFetch(channel,"table1",rownames=TRUE) df2