[R] quantiles with approximately the same number of data points within each quantile?

2013-12-06 Thread Anika Masters
What is a "good" way to create quantiles with approximately the same number of data points within each quantile? __ 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/p

[R] capturing warnings within loops, so I know the iterations where warnings occurred?

2013-09-23 Thread Anika Masters
I am running a loop. Warnings sometimes occur, and the lop continues until the end. For each iteration of the loop, I wish to capture and "save" any warnings issued, so that I can tell on which iteration the warnings were issued. I tried this, but it does not work. mylist <- list(NULL) mylist_war

Re: [R] using "rollapply" to calculate a moving sum or running sum?

2013-08-02 Thread Anika Masters
NA > #[15,] NA NA NA NA NA > #[16,] NA NA NA NA NA > #[17,] NA NA NA NA NA > #[18,] NA NA NA NA NA > #[19,] NA NA NA NA NA > #[20,] NA NA NA NA NA > A.K. > > > > - Original Message - > From:

[R] using "rollapply" to calculate a moving sum or running sum?

2013-06-27 Thread Anika Masters
#using "rollapply" to calculate a moving sum or running sum? #I am tryign to use rollapply to calcualte a moving sum? #I tried rollapply and get the error message #"Error in seq.default(start.at, NROW(data), by = by) : # wrong sign in 'by' argument" #example: mymatrix <- ( matrix(data=1:100, nr

[R] when to use & pros/cons of dataframe vs. matrix?

2013-06-27 Thread Anika Masters
When "should" I use a dataframe vs. a matrix? What are the pros and cons? If I have data of all the same type, am I usually better off using a matrix and not a dataframe? What are the advantages if any of using a dataframe vs. a matrix? (rownames and column names perhaps?) ___

Re: [R] pasting columns of a dataframe together

2013-06-26 Thread Anika Masters
for any help you can offer. (I am using R x64 2.15.2 on Windows 7.) On Wed, Jun 26, 2013 at 3:14 PM, Anika Masters wrote: > I want to "paste" the contents of the first column of a dataframe > with all the columns of the same dataframe. > > > > What is a "good"

[R] pasting columns of a dataframe together

2013-06-26 Thread Anika Masters
I want to "paste" the contents of the first column of a dataframe with all the columns of the same dataframe. What is a "good" way to do this, perhaps something more elegant than what I have below. (My actual dataframe has ~400 columns and ~35000 rows.) example1: mydf <- data.frame( matrix

Re: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread Anika Masters
e Professor of Anthropology > Texas A&M University > College Station, TX 77843-4352 > > > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of arun >> Sent: Tuesday, February 26, 2013 1:14

[R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread Anika Masters
#I want to "merge" or "join" 2 dataframes (df1 & df2) into a 3rd (mydf). I want the 3rd dataframe to contain 1 row for each row in df1 & df2, and all the columns in both df1 & df2. The solution should "work" even if the 2 dataframes are identical, and even if the 2 dataframes do not have the same

Re: [R] combining 2 dataframes into a 3rd df, with 1 row for each row in df1 & df2

2013-02-26 Thread Anika Masters
'c') ) ) ) I figured it out. mydf <- merge(df2,df1,all.y=T, all.x=T) mydf2 <- mydf[,sort(names(mydf))] On Tue, Feb 26, 2013 at 8:34 AM, Anika Masters wrote: > # 'I need help combining 2 dataframes (df1 & df2) into a 3rd (mydf). > I want the 3rd dataframe to conta

[R] combining 2 dataframes into a 3rd df, with 1 row for each row in df1 & df2

2013-02-26 Thread Anika Masters
# 'I need help combining 2 dataframes (df1 & df2) into a 3rd (mydf). I want the 3rd dataframe to contain 1 row for each row in df1 & df2, and all the columns in both df1 & df2. # Advice is appreciated. Thank you. df1 <- data.frame(matrix(data=c(7, 99, 12) , nrow=1 , dimnames = list( NULL , c('a

[R] combining dataframes into single df with all columns

2013-02-07 Thread Anika Masters
#I have 2 dataframes df1 & df2. Each has a subset of all possible column names. #How do I combine the 2 tables so that they contain all column names? data1 <- c('2','3', '6', '8' , '9') data2 <- c('1', '2', '3', '6') df1 <- data.frame(matrix(data=NA, nrow=1, ncol=length(data1), dimnames=list(NULL

[R] combining dataframes into single df with all columns

2013-02-07 Thread Anika Masters
#I have 2 dataframes df1 & df2. Each has a subset of all possible column names. #How do I combine the 2 tables so that they contain all column names? data1 <- c('2','3', '6', '8' , '9') data2 <- c('1', '2', '3', '6') df1 <- data.frame(matrix(data=NA, nrow=1, ncol=length(data1), dimnames=lis

[R] download and save all files from FTP site?

2013-02-04 Thread Anika Masters
What are "good" ways, within R, to download all files (perhaps including folders/directories?) from an FTP site and then save these files to a local hard drive? Is try(getURL) {RCurl} and save() the "best" functions to utilize? Any other suggestions? [[alternative HTML version deleted]]

[R] XBRL data into R?

2013-01-30 Thread Anika Masters
Has anyone explored pulling XBRL formatted data into R? [[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-guid

Re: [R] converting XML document to table or dataframe

2013-01-29 Thread Anika Masters
semius wrote: > > On Jan 28, 2013, at 9:00 PM, Anika Masters wrote: > > I am a relatively new user to R, and I am trying to learn more about >> converting data in an XML document into "2-dimensional format" such as a >> table or array. I might eventually wish to

[R] converting XML document to table or dataframe

2013-01-28 Thread Anika Masters
I am a relatively new user to R, and I am trying to learn more about converting data in an XML document into "2-dimensional format" such as a table or array. I might eventually wish to export this data into a relational database such as SQL, and/or to work with this data within the R package. My