similar to: Reorganize(stack data) a dataframe inducing names

Displaying 20 results from an estimated 2000 matches similar to: "Reorganize(stack data) a dataframe inducing names"

2010 Feb 24
2
Calling Data frame objects with spaces in their names
Hello I have the following data frame which I read from an EXCEL file, and when i try to call one of its columns with a space in their names I am not being able to. For example if I do EURODOLLAR$ED1.Comdty Date I obtain the following error: Error: inesperado símbolo en "EURODOLLAR$ED1.Comdty Date" I have also tried using . or _ instead of the space and have obtained no succes. How do I
2007 Feb 13
2
Computing stats on common parts of multiple dataframes
Folks, I have three dataframes storing some information about two currency pairs, as follows: R> a EUR-USD NOK-SEK 1.23 1.33 1.22 1.43 1.26 1.42 1.24 1.50 1.21 1.36 1.26 1.60 1.29 1.44 1.25 1.36 1.27 1.39 1.23 1.48 1.22 1.26 1.24 1.29 1.27 1.57 1.21 1.55 1.23 1.35 1.25 1.41 1.25 1.30 1.23 1.11 1.28 1.37 1.27 1.23 R> b EUR-USD NOK-SEK 1.23 1.22 1.21 1.36 1.28 1.61 1.23 1.34 1.21 1.22
2011 Jan 19
1
Problem in using bdh function for Govt tickers
Hi, all I wanted to fetch data from Bloomberg for govt bonds, and analyse it further. I am having trouble in getting data as when I use field=PX_LAST, it is giving the prices but when I use field=CPN, or ISSUE_DT, it is not giving the results and just bouncing back <NA> for that. This is the piece of code: > library(rJava) Warning message: package 'rJava' was built
2023 Jan 31
3
How to calculate the derivatives at each data point?
Hi everyone, I have a vector with atmospheric measurements (x-axis) that is obtained/calculated at different altitudes (y-axis). The altitude is uniformly distributed every 7 meters. For example my dataframe is: df <- dataframe( *altitude* = c(1005, 1012, 1019, 1026, 1033, 1040, 1047, 1054, 1061, 1068), *atm_values* = c(1.41, 1.40, 1.39, 1.38, 1.37, 1.37, 1.38, 1.36, 1.33, 1.31)
2010 Jul 15
1
loess line predicting number where the line crosses zero twice
These data represent stream channel cross-sectional surveys. I would like to be able to find the measurement on the tape (measure) where the Bank Full Depth (bkf_depths) is 0. This will happen twice because the channel has two sides. I thought fitting a loess line to these data and then predicting the measurment number would do it. I was wrong. Below is my failed attempt. My naive thought is
2006 Feb 22
2
Error in RBloomberg
Hello R-Experts, Currently I'm using "RBloomberg" package in R-2.2.1 in Windows machine ( XP). When I'm running one specific example using blpGetData given in help file I'm getting the following error message. conn <- blpConnect() edb <- blpGetData(conn, "ED1 Comdty", "PX_LAST", start=chron("1/1/06"),
2023 Jan 31
1
How to calculate the derivatives at each data point?
Hi Konstantinos Not exactly derivative but > diff(df[,2]) [1] -0.01 -0.01 -0.01 -0.01 0.00 0.01 -0.02 -0.03 -0.02 May be enaough for you. Cheers Petr > > -----Original Message----- > From: R-help <r-help-bounces at r-project.org> On Behalf Of konstantinos > christodoulou > Sent: Tuesday, January 31, 2023 10:16 AM > To: r-help mailing list <r-help at
2008 Jun 25
2
Is this sapply behaviour normal?
Hi, I'm trying to use sapply to compute the min of several variables, each of them stored in data.frames, grouped as a list: Is it normal that mean() and min() produce different objects dimensions? > str(dats) List of 5 $ log20:'data.frame': 83 obs. of 5 variables: ..$ DATE : int [1:83] 2001081500 2001081512 2001081600 2001081612 2001081700 2001081712
2023 Jan 31
1
[EXT] How to calculate the derivatives at each data point?
Try something like with(df, predict(smooth.spline(x = altitude, y = atm_values), deriv = 1)) Cheers, Andrew -- Andrew Robinson Chief Executive Officer, CEBRA and Professor of Biosecurity, School/s of BioSciences and Mathematics & Statistics University of Melbourne, VIC 3010 Australia Tel: (+61) 0403 138 955 Email: apro at unimelb.edu.au Website: https://researchers.ms.unimelb.edu.au/~apro
2006 Sep 13
2
kendall's w
Hi, I try to calculate Kendall's W coefficient and I have a bizarre error. little.app.mat<-matrix(c(1,3,4,2,6,5,2,4,3,1,5,6,3,2,5,1,5,4),nrow=3,byrow=TRUE) print(kendall.w(little.app.mat[-1,])) >>> Kendall's W for ordinal data >>> W = 0.7753623Error in if (is.na(x$p.table)) { : argument is of length zero
2010 Mar 17
2
Troubles on retrieving rownames
Hi guys, I am using the blp() function from RBloomberg package which returns a matrix of prices with the columns corresponding to the security name and the columns to the date. When I have a look at the matrix I can see the rownames (dates) on the left of the prices but when I call the rownames() function it returns me a NULL value. It worked perfectly until I had to reinstall the RBloomberg
2009 Nov 22
3
Define return values of a function
I have created a function to do something: i <- factor(sample(c("A", "B", "C", NA), 793, rep=T, prob=c(8, 7, 5, 1))) k <- factor(sample(c("X", "Y", "Z", NA), 793, rep=T, prob=c(12, 7, 9, 1))) mytable <- function(x){ xtb <- x btx <- x # do more with x, not relevant here cat("The table has been created,
2010 Feb 17
2
extract the data that match
Hi r-users,   I would like to extract the data that match.  Attached is my data: I'm interested in matchind the value in column 'intg' with value in column 'rand_no' > cbind(z=z,intg=dd,rand_no = rr)             z  intg rand_no    [1,]  0.00 0.000   0.001    [2,]  0.01 0.000   0.002    [3,]  0.02 0.000   0.002    [4,]  0.03 0.000   0.003    [5,]  0.04 0.000   0.003    [6,] 
2017 Feb 17
2
Plan for libguestfs 1.36
Libguestfs 1.34 was released on 2016-08-08, which is about 6 months ago. I'd would like to think about what needs work for the next stable 1.36 release, which might happen at the end of this month. Any new APIs added in the 1.35 cycle will become supported and guaranteed when we release 1.36, so we need to check those. See: git diff v1.34.0 -- generator/actions.ml It looks like there
2009 Mar 08
2
plot confidence limits of a regression line - problem
hi, I don't know what I am doing wrong, but with that code; x1 <- c(1.60, 0.27, 0.17, 1.63, 1.37, 2.00, 0.90, 1.07, 0.89, 0.43, 0.37, 0.59, 0.47, 1.83, 1.79, 0.90, 0.72, 1.83, 0.23, 1.97, 2.03, 2.19, 2.03, 0.86) x2 <- c(1.30, 0.24, 0.20, 0.50, 1.33, 1.87, 1.30, 0.75, 1.07, 0.43, 0.37, 0.87, 1.40, 1.37, 1.63, 0.80, 0.57, 1.60, 0.39, 2.03, 1.90, 2.07, 1.93, 0.93) model <-
2013 May 15
1
x and y lengths differ
I have a problem with R. I try to compute the confidence interval for my df. When I want to create the plot I have this problem: Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ. I try this code: library(dplR) df.rwi <- detrend(rwl = df, method = "Spline",nyrs=NULL) write.table(df.rwi,file="rwi.txt",quote=FALSE,row.names=TRUE)
2012 Apr 03
5
Import from excel button in R-command
Hello I have been searching for almost 2 hours for a certain plug-in/package, so im making this thread as i hope you can help me find it. I had my first lesson in "Statistics in use" today, and when we worked on the school computers, we could do this to import data from excel: Data > Import Data > Import from excel or "something else" Now i downloaded it for my
2012 Jul 30
2
distance matrix and hclustering
Dear R Users,i am very new to R. I want your help on an issue regarding distance matrix and cluster analysis i had discharge data of 4 rivers(a,b,c,d) in 4 vectors each having 364 values > dput(qmu)structure(list(a = c(0.26, 0.25, 0.25, 0.25, 0.24, 0.23, 0.22, 0.21, 0.21, 0.21, 0.2, 0.19, 0.19, 0.19, 0.19, 0.18, 0.18, 0.18, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17,
2012 May 18
3
How to fix indeces in a loop
Dear Contributors, I have an easy question for you which is puzzling me instead. I am running loops similar to the following: for (i in c(100,1000,10000)){ print((mean(i))) #var<-var(rnorm(i,0,1)) } This is what I obtain: [1] 100 [1] 1000 [1] 10000 In this case I ask the software to print out the result, but I would like to store it in an object. I have tried a second loop, because if I
2024 Feb 27
1
Interactions in regression
I have no real idea what you are trying to do, but if a table is what you want, you can probably get it using the table() function. Or, more likely, the xtabs() function. Using your example from an earlier post (adjusted to make it comprehensible to the human mind): set.seed(1000) time <- factor(rep(c("Pre","Post"),each=200)) treatment <-