[R] help using function merge_all()
Hi, I want to merge 4 data frames with one column in common but I am getting error message while using this function. Can any one help me out. > merge_all(Br,Ki,Lu,Pr,by="Genes") Error: could not find function "merge_all" I have installed the package: reshape but I still get this error -- View this message in context: http://r.789695.n4.nabble.com/help-using-function-merge-all-tp3045173p3045173.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help using function merge_all()
Hi Josh, Thanks for your reply. While I am loading the package, it says package plyr is required and I tried to install plyr package but I am unable to do so because it is giving an error message as shown below. Please help me. library(reshape) Loading required package: plyr Error: package 'plyr' could not be loaded In addition: Warning message: In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : there is no package called 'plyr' > utils:::menuInstallPkgs() trying URL 'http://cran.mtu.edu/bin/windows/contrib/2.11/plyr_1.1.zip' Error in download.file(url, destfile, method, mode = "wb", ...) : cannot open URL 'http://cran.mtu.edu/bin/windows/contrib/2.11/plyr_1.1.zip' In addition: Warning message: In download.file(url, destfile, method, mode = "wb", ...) : cannot open: HTTP status was '404 Not Found' Warning in download.packages(pkgs, destdir = tmpd, available = available, : download of package 'plyr' failed -- View this message in context: http://r.789695.n4.nabble.com/help-using-function-merge-all-tp3045173p3045537.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help using function merge_all()
Hi Josh, I thought of giving up and started writing code in excel using VBA but then I saw ur message and gave a try in R. I got it, the location from which I am calling the package "plyr" is not working out so called from different CRANmirror location and then I was able load the package. now the merge_all function is working fine. Thanks for your help. -- View this message in context: http://r.789695.n4.nabble.com/help-using-function-merge-all-tp3045173p3045561.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Streaming data connection in R
Hello, Is there a way to establish connection between Kafka and R? I know it exists for Hadoop and R. In big db architecture, I have Cassandra(storage), Spark(aggregation) and Kafka(read/write). Thanks, Arjun Satya We raise our voice, so that our echo may shape a better tomorrow. TIMES NOW- Action Begins Here Disclaimer :- The information in this e-mail and any attachments is co...{{dropped:18}} __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] trouble installing quantreg packages
I am trying to install the "quantreg Package" on MacOSX. When I choose CRAN mirror, it gives me the error: Error in read.dcf(file = tmpf) : Line longer than buffer size In addition: There were 44 warnings (use warnings() to see them) Is there any known current problem with this package? Sincerely Arjun Adhikari -- Doctoral Instructional Assistant Texas State University Department of Biology 601 University Dr. San Marcos, TX, 78666, USA Executive Editor Himalayan Journal of Sciences www.himjsci.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Aggregating by a grouping
Suppose I have: BookValue A 10 B 11 C 9 D 8 A 12 C 4 D 5 B 7 I want to summarize above not by Book but by groupings of Books as in (below) I have a list ... basic_map <- list(c("A",B"),c("C,D")) Big_names <- c("A1", "A2") Names(basic_map) <- big_names So I want to get : A1 40 A2 26 How do I use tapply AND the list to get my custom groupings? thx This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Rbind-ing a list into one item
Hi, I am doing the following: 1. I have a list of files.. Files1=list.files("some directory",pattern="some pattern") 2. I define a list as res=vector("list", length(files1)) 3. I read all the files into this list: res=lapply(files1, read.csv) I now want to rowbind all the items in the list into one big mass (all files have same number of columns). I tried lapply(res, rbind) but that did not work. Suggestions? This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Error with rbind and zoo
Hi all: I have a directory of files as in -> bunchafiles <- list.files(path="/data/2.3/2006", pattern="returns", full.names=T,recursive=T) Each file is a bunch of returns for a particular date (unique). There are like 252 files or so. With a custom function myread (below), I define a vector - res <- vector("list",length=length(bunchafiles)) , and read files into it res <- lapply(bunchafiles, myread) myread <- function (x) { y <- read.csv(x, as.is=T, header=T) if (nrow(y) > 0) { quotedate <- strsplit(strsplit(x,"/",fixed=T)[[1]][11],".",fixed=T)[[1]][1] a <- rep(quotedate, nrow(y)) y <- zoo(y,a) } return(y) } I now have a list of zoo'd files. Each of them is indexed by a date which is unique. All fine so far. Now, I want to combine all of these into one large zoo object. So I say -- bigzoo <- do.call(rbind, res) I now get an error "rbind(...): indexes overlap"... I am now wondering how? Because when I do the foll - for (i in 1:length(res)) {cat(i," ",unique(index(res[i][[1]])),"\n")} I see that I have unique indexes for each res So why is rbind behaving thus? This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Extracting last time value
I have a dataframe as follows: Datetimevalue 2011062011:18:007 2011062011:39:009 2011062111:41:008 2011062111:40:006 2011062214:05:008 2011062214:06:006 For every date, I want to extract the row that has the greatest time. Therefore, ending up like: 2011062011:39:009 2011062111:41:008 2011062214:07:006 I am using for loops (for every date, find largest time value) to do this determination, but I am sure there is a simpler way in "R". Has anyone run into this before? This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Extracting last time value
Thank you, Gabor, Jim, and Achim!! All of your suggestions/pointers were extremely useful. -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Thursday, January 10, 2008 7:46 PM To: Kondamani, Arjun (GMI - NY Corporate Bonds) Cc: r-help@r-project.org Subject: Re: [R] Extracting last time value Here is a slight variation of ones you have already received. This also uses zoo. In the DF<- line we read it in as a data frame. In the z<- line we convert it to zoo using chron date/times (see R News 4/1 for more). We calculate the positions of duplicate dates and in the last line we extract the rows corresponding to non-duplicates. Lines <- "Datetimevalue 2011062011:18:007 2011062011:39:009 2011062111:41:008 2011062111:40:006 2011062214:05:008 2011062214:06:006 " library(zoo) library(chron) DF <- read.table(textConnection(Lines), header = TRUE, as.is = TRUE) z <- zoo(DF$value, chron(unclass(as.Date(format(DF$Date), "%Y%m%d"))), DF$time) isdup <- duplicated(dates(time(z)), fromLast = TRUE) z[!isdup,] For more on zoo see: library(zoo) vignette("zoo") vignette("zoo-quickref") On Jan 10, 2008 5:36 PM, Kondamani, Arjun (GMI - NY Corporate Bonds) <[EMAIL PROTECTED]> wrote: > I have a dataframe as follows: > > Datetimevalue > 2011062011:18:007 > 2011062011:39:009 > 2011062111:41:008 > 2011062111:40:006 > 2011062214:05:008 > 2011062214:06:006 > > For every date, I want to extract the row that has the greatest time. > Therefore, ending up like: > 2011062011:39:009 > 2011062111:41:008 > 2011062214:07:006 > > I am using for loops (for every date, find largest time value) to do > this determination, but I am sure there is a simpler way in "R". Has > anyone run into this before? > > > This message w/attachments (message) may be privileged, confidential > or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing. > > >[[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Re-Casting
R-experts, I have a bunch of files (by date) that I can read into dataframes as below. df$today: identifier rtgmdy rtgmdy_dt rtgmdy_watchrtgmdy_nowatch rtgmdy_watch_dt rtgsp rtgsp_dt 31031 Aa3 20050701Aa3 NA AA- 20050510 31086 B1 20070920B1 NA B+ 20070828 31106 Baa220040326Baa2NA BBB 20051003 31170 Baa320070601Baa3NA BBB+ 20051024 31225 Ba2 20070601Ba2 NA BB+ 20070423 31386 Baa320070320Baa3NA BBB- 20040331 df$20050701: identifier rtgmdy rtgmdy_dt rtgmdy_watchrtgmdy_nowatch rtgmdy_watch_dt rtgsp rtgsp_dt 31031 Aa2 20030501Aa3 NA AA- 20050510 I want to re-cast the combination of df$today and df$20050701 as follows: PART A: Ideal result: Where I can have just identifiers and dates and see what changed for that date(s), and also what it changed from. I realize that it takes a combo of some nifty melt and cast work that my iterations have thus far not resulted. identifier Chg DateVar1Var2Var3=(Previous Var2) 31031 20050701rtgmdy Aa3 Aa2 31031 20050510rtgsp AA- 31086 20070920rtgmdy B1 31086 20070828rtgsp B+ PART B: Less than ideal result (where we don't the lookup to get the previous value). I'll live with this type of result also. I realize the lookups can be expensive computationally. identifier Chg DateVar1Var2 31031 20050701rtgmdy Aa3 31031 20050510rtgsp AA- 31086 20070920rtgmdy B1 31086 20070828rtgsp B+ Any pointers? Thanks! This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.