similar to: Can data.frame be saved as image?

Displaying 20 results from an estimated 2000 matches similar to: "Can data.frame be saved as image?"

2013 Mar 28
6
How to delete Identical columns
Dear R forum Suppose I have a data.frame df = data.frame(id = c(1:6), x = c(15, 21, 14, 21, 14, 38), y = c(36, 38, 55, 11, 5, 18), x.1 = c(15, 21, 14, 21, 14, 38), z = c("D", "B", "A", "F", "H", "P")) > df   id  x  y    x.1 z 1  1 15 36  15 D 2  2 21 38  21 B 3  3 14 55  14 A 4  4 21 11  21 F 5  5 14  5  14 H 6  6 38 18  38 P
2013 Apr 16
3
Splitting the Elements of character vector
Dear R forum I have a data.frame df = data.frame(currency_type = c("EURO_o_n", "EURO_o_n", "EURO_1w", "EURO_1w", "USD_o_n", "USD_o_n", "USD_1w", "USD_1w"), rates = c(0.47, 0.475, 0.461, 0.464, 1.21, 1.19, 1.41, 1.43))   currency_type     rates 1      EURO_o_n   0.470 2      EURO_o_n   0.475 3       EURO_1w   0.461
2013 Apr 15
6
Sorting data.frame and again sorting within data.frame
Dear R forum, I have a data.frame as defied below - df = data.frame(names = c("C", "A", "A", "B", "C", "B", "A", "B", "C"), dates = c("4/15/2013", "4/13/2013", "4/15/2013", "4/13/2013", "4/13/2013", "4/15/2013", "4/14/2013",
2012 Dec 20
2
How to count the nos. in a range?
Dear R forum I have a following vector of random no.s x = runif(100, 0.01, 0.99)  [1] 0.47212037 0.77867992 0.33947474 0.93369035   [5] 0.03720073 0.79307831 0.81801835 0.92710688 ................................................. I need to count the random no. falling in the range (0 - 0.10), (0.10 - 0.20), (0.20 - 0.30)..upto (0.90 - 1) Thus, I need to have a data frame as
2013 Apr 03
4
Better way of writing R code
Dear R forum, (Pl note this is not a finance problem) I have two data.frames as currency_df = data.frame(current_date = c("3/4/2013", "3/4/2013", "3/4/2013", "3/4/2013"), issue_date = c("27/11/2012", "9/12/2012", "14/01/2013", "28/02/2013"), maturity_date = c("27/04/2013", "3/5/2013",
2013 Oct 17
4
Subseting a data.frame
Dear Forum, I have a data frame as  mydat = data.frame(basel_asset_class = c(2, 8, 8 ,8), defa_frequency = c(0.15, 0.07, 0.03, 0.001)) > mydat   basel_asset_class defa_frequency 1                 2          0.150 2                 8          0.070 3                 8          0.030 4                 8          0.001 I need to get the subset of this data.frame where no of records for the
2013 Oct 17
4
Subseting a data.frame
Dear Forum, I have a data frame as  mydat = data.frame(basel_asset_class = c(2, 8, 8 ,8), defa_frequency = c(0.15, 0.07, 0.03, 0.001)) > mydat   basel_asset_class defa_frequency 1                 2          0.150 2                 8          0.070 3                 8          0.030 4                 8          0.001 I need to get the subset of this data.frame where no of records for the
2013 Apr 17
3
Creating a vector with repeating dates
Dear R forum I have a data.frame df = data.frame(dates = c("4/15/2013", "4/14/2013", "4/13/2013", "4/12/2013"), values = c(47, 38, 56, 92)) I need to to create a vector by repeating the dates as "Current_date", 4/15/2013, 4/14/2013, 4/13/2013, 4/12/2013,  "Current_date", 4/15/2013, 4/14/2013, 4/13/2013, 4/12/2013, Current_date,
2013 Oct 16
1
How to write an error to output
Dear R forum, The example below is just an indicative one and I have constructed it. My real life data and conditions are different. I have a data.frame as given below mydat = data.frame(A = c(19, 20, 19, 19, 19, 18, 16, 18, 19, 20), B = c(19, 20, 20, 19, 20, 18, 19, 18, 17, 16)) if (length(mydat$A) > 10) { stop("A has length more than 10") }else if (max(mydat$B) > 18) {
2013 Mar 26
2
Counting various elemnts in a vactor
Dear R forum I have a vector say as given below df = c("F", "C", "F", "B", "D", "A", "D", "D", "A", "F", "D", "F", "B",    "C") I need to find (1) how many times each element occurs? e.g. in above vector F occurs 4 times, C occurs 2 times etc. (2)
2013 Apr 26
2
Splitting data.frame and saving to csv files
Dear R Forum, I have a data.frame as df = data.frame(date = c("2013-04-15", "2013-04-14", "2013-04-13", "2013-04-12", "2013-04-11"), ABC_f = c(62.80739769,81.04525895,84.65712455,12.78237251,57.61345256), LMN_d = c(21.16794336,54.6580401,63.8923307,87.59880367,87.07693716), XYZ_p = c(55.8885464,94.1358684,84.0089114,98.99746696,64.71083712),
2013 Apr 29
2
Adding elements in data.frame subsets and also subtracting an element from the rest elements in data.frame
Dear R forum I have a data.frame as cashflow_df = data.frame(instrument = c("ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC", "ABC", "PQR", "PQR",
2013 Mar 27
1
Archieve of mails from R forum
Dear R helpers, Everyday I do receive many many mails from R forum and after some period of times, INBOX is filled with numerous mails. At times if for some period of time, I haven't accessed mails, it becomes difficult to keep track of mails and many times simply due to the volume (and owing to the lack of time due to office constraints), I have to simply delete the mails without opening
2013 Apr 25
1
Linear Interpolation : Missing rates
Dear R forum I have data.frame as df = data.frame(rate_name = c("USD_1w", "USD_1w", "USD_1w", "USD_1w", "USD_1m", "USD_1m", "USD_1m", "USD_1m", "USD_2m", "USD_2m", "USD_2m", "USD_2m",  "GBP_1w", "GBP_1w", "GBP_1w", "GBP_1w",
2010 Oct 21
4
data.frame query
Hi All, Apologies for the simplicity of my question, but I would be grateful for any advice. Thanks I'm trying to put the output from a for loop into a data frame, however I have not been successful. The steps I have taken are: *R-code:* >for (k in 1:(nt-1-n0) ){ > n<- n0-1+k > lam=n/nt > Q=x[n] > output1<-data.frame(cbind(k,n,lam,Q)) > output1 > }
2007 Jun 19
1
A question about plots and lists in functions
R-helpers: I tried googling and couldn't find anything. I have a function I am sourcing into R that does some calculations to generate a simulated dataset. I currently have a a list set up to store the outputs from the function and a plot of one of them (a set of ordered pairs) like this: foo<-function(x,y,z){ ## do some work here ## list(x=x,y=y,z=z,output1=output1,output2=output2,
2010 Dec 23
5
Writing a single output file
Dear R helpers! Let me first wish all of you "Merry Christmas and Very Happy New year 2011" "Christmas day is a day of Joy and Charity, May God make you rich in both" - Phillips Brooks ## ---------------------------------------------------------------------------------------------------------------------------- I have a process which generates number of outputs. The R code
2013 May 02
1
Clean Price of Bond : Can't install "RQuantLib" in R version 3.0.0
Dear Forum, I have R version 3.0.0 installed and need to install RQuantLib pacakge. I tried to install it from CRAN Mirror and I couldn't load it. I had saved the package i zip format and tried to install it locally but I am getting following error. > utils:::menuInstallLocal() Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :  
2013 Jan 23
1
How to extract values of results in gamlss.tr
Dear R helpers, I have following loss data and I need to fit LEFT truncated Log Normal distribution to this data which is Truncated at 1000000. dat = c(1333834,5710254,9987567,7809469,6940935,3473671,1270209,1102523,1124002, 5830159,4302300,3925242,2638409,2324421,7238436,9088709,7439250,4976551,4864319, 8741334,1863770,7098310,4942288,4971829,4986372) library(gamlss.tr) gen.trun(5, LOGNO)
2008 Feb 13
4
rolling sum (like in Rmetrics package)
Hello, I'm new to R and would like to know how to create a vector of "rolling sums". (I have seen the Rmetrics package and the rollMean function and I would like to do the same thing except Sum instead of Mean.) I imagine someone has done this, I just can't find it anywhere. Example: x <- somevector #where x is 'n' entries long #what I would like to do is: x1