similar to: Log difference in a dataframe column

Displaying 20 results from an estimated 200 matches similar to: "Log difference in a dataframe column"

2011 Jan 28
1
There must be a smarter way
Newbie and trying to learn the right way of doing things in R. in this case, I just have that feeling that my convoluted line of code is way more complicated than it needs to be. Please help me in seeing the easier way. I want to do something pretty simple. I have a dataframe called x that is 6945 elements long. I'd like to create a vector rtn= log(x[2,2]/x[1,3]), then log(x[3,2]/x[2,3]),
2011 Nov 29
2
aggregate syntax for grouped column means
I am calculating the mean of each column grouped by the variable 'id'. I do this using aggregate, data.table, and plyr. My aggregate results do not match the other two, and I am trying to figure out what is incorrect with my syntax. Any suggestions? Thanks. Here is the data. myData <- structure(list(var1 = c(31.59, 32.21, 31.78, 31.34, 31.61, 31.61, 30.59, 30.84, 30.98, 30.79, 30.79,
2006 Apr 27
2
summary(lm(x~y)) difference between R-2.2.1 and R-2.3.0
Hi [macOSX 10.4.6; R-2.3.0] I have encountered a difference in behaviour between R-2.2.1 and R-2.3.0 when performing a linear model. Transcript follows for R-2.3.0 (R-2.2.1 worked as expected). How to make R-2.3.0 perform as R-2.2.1 did? > dput(x) c(29.13, 29.88, 30.09, 29.99, 29.74, 29.64, 29.65, 29.7, 30.04, 29.89, 29.96, 29.65, 28.76, 28.41, 28.38, 29.55, 29.76, 29.75, 29.84,
2007 Sep 11
2
Help regading time series data reading
Dear R-Users, Have a question about reading in some data and manipulating dates. I have a data set in excel which looks like this: Date PEG ETN HSP PTC 13/10/2004 41.92 64.75 29.86 9.27 14/10/2004 41.93 61.79 29.98 9.14 15/10/2004 41.69 62.7 30.09 9.04 18/10/2004
2010 Jan 04
1
log-normal overlay
Hello, Using the following lines of code, I created the following graph:
2010 Jan 04
1
log normal overlay
Hello, Using the following lines of code, I created the following graph:
2010 Sep 16
2
question about converting a matrix to a dataframe
First I have a matrix called stocks1: > class(stocks1) [1] "matrix" Here are the first 5 rows of the last 4 columns: > stocks1[1:5,2:5] [,1] [,2] [,3] [,4] [1,] 80.73 31.95 25.4 25.69 [2,] 83.66 31.95 27.12 25.2 [3,] 83.27 32.93 28.74 26.29 [4,] 83.9 34.07 29.77 26.6 [5,] 82.74 35.18 30.24 27.41 Now, why can't I convert this into a dataframe?
2017 Dec 07
1
Seeking help with code
Assuming the days of raining during half a year of all states(provinces) of a country is normally distributed (mean=?, standard deviation=?) with sigma (?) equals to 2. We now have 10 data points here: 26.64, 30.65, 31.27, 33.04, 32.56, 29.10, 28.96, 26.44, 27.76, 32.27. Try to get the 95% level of CI for ?, using parametric Bootstrap method with bootstrap size B=8000. my code - what am i doing
2010 Apr 28
3
data frame move columns
Dear group, Here is my df: avprix <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN May/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SPCL HIGH GRADE ZINC USD", "STANDARD LEAD USD"), prix = c(-1.5, -1082, 11084, 1983.5, -2464, -118), quantity = c(0, -3, 8, 2, -1, 0), fees = c(-8.64, -30.24, -26.4, -25.92, -37.5,
2011 Feb 02
3
reshape data, adding rows to dataframe
Hello everyone, I have a data set like this: > head( fish_transect) ID_TRANSECT ID_PROJECT DE_ZONE DE_LOCALITY DE_SECTOR MES 1 42 MB Tarragona Creixell Control I 9 2 42 MB Tarragona Creixell Control I 9 3 42 MB Tarragona Creixell Control I 9 4 42 MB Tarragona Creixell Control I 9 5 42
2011 Jan 14
4
test
Hi, i have that table Thesis Day A B C 1 0 83.43 90.15 22.97 1 0 85.50 94.97 16.62 1 0 83.36 95.38 20.70 1 0 84.47 92.16 23.58 1 0 83.98 95.33 19.39 1 0 82.86 93.78 24.55 1 0 83.39 92.67 19.56 1 0 85.17 95.24 17.95 1 0 81.62 93.32 28.49 1 0 82.99 92.85 19.73 1 0 81.11 95.67 27.20 1 0 83.39 94.69 16.51 1 0 79.56 89.87 30.39 1 0 80.54 93.32 21.76 1 0 82.11 92.58 22.17 1 14 85.65 94.00 19.19 1 14
2015 May 14
3
comportamiento de data.table al hacer calculos por grupos
Estimada comunidad tengo un problema del que no encuentro datos que me ayuden mucho en la web. Estoy haciendo calculos por grupos con data,table. Tengo un archivo (zp.res) con tres columnas que clasifican los datos (sol, con, dia) y una columna de datos numericos (media), de la siguiente forma: sol con dia media 1: con 0 1 -22.6 2: con 0 1 -36.6 3: con 0 1 -35.6 y
2009 May 04
2
Calculating relative ratios in a data frame..
I have a data-set that is structured as follows: sp wg n v.realtime v.cputime v.tcputime v.idletime v.nswtch 9 0 1 1 28.61300 28.61 28.6039 0.00000e+00 407 1563 0 1 2 15.20270 30.38 28.5981 9.80523e-01 483 3128 0 1 4 12.50930 50.00 28.6053 1.07877e+01 489 4682 0 1 6 12.10260 72.55
2007 Dec 03
1
Plotting monthly timeseries with an x-axis in "time format"
I have the following timeseries "tab" ===================================== > str(tab) mts [1:23, 1:2] 79.5 89.1 84.9 75.7 72.8 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr [1:2] "Ipex...I" "Omel...E" - attr(*, "tsp")= num [1:3] 2006 2008 12 - attr(*, "class")= chr [1:2] "mts" "ts" > tab
2010 Aug 04
3
merge two data frames
Dear list, here are my two data frames: av <- structure(list(DESCRIPTION = c("COFFEE C Sep/10", "COPPER Sep/10", "CORN Dec/10", "CRUDE OIL miNY Sep/10", "GOLD Aug/10", "HENRY HUB NATURAL GAS Sep/10", "PALLADIUM Sep/10", "SILVER Sep/10", "SOYBEANS Nov/10", "SPCL HIGH GRADE ZINC USD", "SUGAR
2003 May 29
2
R summary
Dear all i use R only a few days and don't understand the difference between fivenum(x) und summary(x). > x [1] 20.77 22.56 22.71 22.99 26.39 27.08 27.32 27.33 27.57 27.81 28.69 29.36 [13] 30.25 31.89 32.88 33.23 33.28 33.40 33.52 33.83 33.95 34.82 > fivenum(x) [1] 20.770 27.080 29.025 33.280 34.820 > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 20.77 27.14
2014 Oct 27
3
"No free sectors available" while try to extend logical volumen in a virtual machine running CentOS 6.5
I'm trying to extend a logical volume and I'm doing as follow: 1- Run `fdisk -l` command and this is the output: Disk /dev/sda: 85.9 GB, 85899345920 bytes 255 heads, 63 sectors/track, 10443 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier:
2012 Oct 30
2
issues with krige function
Greetings all, Ran into a strange problem with the krige function from geoR. The problem that I am having is that while the krige function seems to work well, the resulting predicted values are all NAs. Given the size of the datasets I am working with can't attach it, but I can provide snippets of the datasets. > casedata station year month day obs mpe bias type
2005 Aug 18
1
How to put factor variables in an nls formula ?
Hello, I want to fit a Gompertz model for tree diameter growth that depends on a 4 levels edaphic factor (?Drain?) and I don?t manage to introduce the factor variable in the formula. Dinc is the annual diameter increment and D is the Diameter. >treestab > Dinc D Drain [1,] 0.03 26.10 2 [2,] 0.04 13.05 1 [3,] 0.00 24.83 1 [4,] 0.00 15.92 4
2011 Jan 19
2
count of factors
Hello everyone, I have a data set like this: > head( fish_transect) ID_TRANSECT ID_PROJECT DE_ZONE DE_LOCALITY DE_SECTOR MES 1 42 MB Tarragona Creixell Control I 9 2 42 MB Tarragona Creixell Control I 9 3 42 MB Tarragona Creixell Control I 9 4 42 MB Tarragona Creixell Control I 9 5 42