Displaying 20 results from an estimated 600 matches similar to: "Subset a datafram according to time"
2013 Mar 12
5
extract values
Hello all!
I have a problem to extract values greater that for example 1820.
I try this code: x[x[,1]>1820,]->x1
Please help me!
Thank you!
The data structure is:
structure(c(2.576, 1.728, 3.434, 2.187, 1.928, 1.886, 1.2425,
1.23, 1.075, 1.1785, 1.186, 1.165, 1.732, 1.517, 1.4095, 1.074,
1.618, 1.677, 1.845, 1.594, 1.6655, 1.1605, 1.425, 1.099, 1.007,
1.1795, 1.3855, 1.4065, 1.138, 1.514,
2006 May 24
2
data.frame
Dear all,
Does any one knows why should I get the following error message, when trying
to do a simple data.frame??
DataF<-data.frame(Subject,BiomR,Spp,Capas,Litter,Herbs,LitterD,MaxCanH,DDifS
p,DSSp,Slope, CanDens,NearestSp)
Erro em data.frame(Subject, BiomR, Spp, Capas, Litter, Herbs, LitterD, :
arguments imply differing number of rows: 202, 0
The data I am using
2010 Sep 17
1
How to compare, match two columns from diferent dataframe and assign values from one datafram to the other
Dear R experts,
I'm new to R. It seems to be a simple question but I just can't find a way to do it. Please help me.
I have two data sets x and y as shown in the following. I want to compare the first two columns in x and y, find the matched ones and assign the relative value from column 2 of y to generate the third column of x. Any help wil be appreciated. Thanks.
> x
[,1]
2007 Jan 24
1
Query about extracting subset of datafram
Hi
I have a table read from a mysql database which is of
the kind
clusterid clockrate
I obtained this table in R as
clockrates_table <-sqlQuery(channel,"select....");
I have a function within which I wish to extract the
clusterid for a given cluster.
Although I know that there is just one row per
clusterid in the data frame, I am using subset to
extract the clockrate.
clockrate =
2011 Nov 29
5
Why Numeric Values Become Factors in Data Frame
I have a data frame with 1 factor, one date, and 37 numeric values:
str(waterchem)
'data.frame': 3525 obs. of 39 variables:
site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 ...
$ sampdate : Date, format: "2007-12-12" "2008-03-15" ...
$ CO3 : num 1 1 6.7 1 1 1 1 1 1 1 ...
$ HCO3 : num 231 228 118 246
2009 Apr 13
2
weighted mean and by() with two index
Hi expeRts,
I would like to calculate weighted mean by two factors.
My code is as follows:
R> tmp <- by(re$meta.sales.lkm[, c("pc", "sales")],
re$meta.sales.lkm[, c("size", "yr")], function(x)
weighted.mean(x[,1], x[,2]))
The result is as follows:
R> tmp
size: micro
yr: 1994
[1] 1.090
2008 Jun 02
4
NOT-SO-SIMPLE function!
I am trying to set up a function which processes my data according to the
following rules:
1. if (x[i]==0) NA
2. if (x[i]>0) log(x[i]/(number of consecutive zeros immediately preceding
it +1))
The data this will apply to include a variety of whole numbers not limited
to 1 & 0, a number of which may appear consecutively and not separated by
zeros. Below is an example with a detailed
2005 Nov 29
1
Indexing variables within lapply?
Hello
I am using R 2.2.0 with Windows XP.
I've got a five element list object, each element containing two
dataframes of equivalent size.
> str(mylist)
List of 1
$ data1:List of 2
..$ data1a :`data.frame': 77 obs. of 63 variables:
.. ..$ var1 : num [1:77] 0.41375 0.00056 1.43040 1.43528 0.61730 ...
.. ..$ var2 : num [1:77] 1.154 1.686 0.673 0.800 0.760 ...
..
2012 Feb 29
2
puzzling results from logistic regression
Hi all,
As you can see from below, the result is strange...
I would imagined that the bb result should be much higher and close to 1,
any way to improve the fit?
Any other classification methods?
Thank you!
data=data.frame(y=rep(c(0, 1), times=100), x=1:200)
aa=glm(y~x, data=data, family=binomial(link="logit"))
newdata=data.frame(x=6, y=100)
bb=predict(aa, newdata=newdata,
2009 Jul 04
1
De que otra forma se puede hacer
Hola que tal alguien de ustedes me podría auxiliar, lo que pasa es que estoy tratando de hacer un programa en R utilizando la siguiente tabla:
x<1 km
x>1km
Estabilidad
a
c
d
f
c
d
f
A
213
440.8
1.94
9.27
459.70
2.094
-9.6
B
156
106.6
1.15
3.30
108.20
1.098
2.0
C
104
61.0
0.91
0.00
61.00
0.911
0.0
D
68
33.2
0.73
-1.70
44.50
0.516
-13.0
E
51
22.8
0.68
-1.30
55.40
0.305
2005 Apr 19
3
Help with predict.lm
Hi
I have measured the UV absorbance (abs) of 10 solutions of a substance at
known concentrations (conc) and have used a linear model to plot a
calibration graph with confidence limits. I now want to predict the
concentration of solutions with UV absorbance results given in the new.abs
data.frame, however predict.lm only appears to work for new "conc" variables
not new "abs"
2012 Mar 29
1
percent_expand for QoS in ControlPath
Hi,
Not sure if this anyone else is interested in this but to me it seems to make
sense to use different control session multiplexer sockets for bulk and
interactive workloads.
Index: auth.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth.c,v
retrieving revision 1.94
diff -u -p -r1.94 auth.c
--- auth.c 23 May 2011 03:33:38 -0000 1.94
+++
2008 May 08
1
Wine errors questions config etc
. wine has the biggest issue with my programs that require a file opened.Ie porgram failed becuase cant open log file or can't find mfc42.dll . do i need to change media permissions ? I was told i could point wine to use xp's api and dlls how would i do that?
mc
2004 Apr 21
3
Webvmail
I am having trouble locating webvmail on my * server.
Is this a seprate porgram or does it come with *. I
am running version
asterick*CLI> show version
Asterisk CVS-03/26/04-17:08:20 built by
root@localhost.localdomain on a i686 running Linux
asterick*CLI>
Thanks
Kurt
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
2009 Mar 30
2
ggplot2-geom_text()
Hi: I need help with geom_text().
I would like to count the number of Locations
and put the sum of it right above each bar.
x <- "Location Lake_dens Fish Pred
Lake1 1.132 1 0.115
Lake1 0.627 1 0.148
Lake1 1.324 1 0.104
Lake1 1.265 1 0.107
Lake2 1.074 0 0.096
Lake2 0.851 0 0.108
Lake2 1.098 0 0.095
Lake2 0.418 0 0.135
Lake2 1.256 1 0.088
Lake2 0.554 1 0.126
Lake2 1.247 1 0.088
2006 Jul 13
3
How do I pass parameters to my program when using WINE?
Hello,
I'm trying to figure out the proper way of passing parameters to my program
that is being run by WINE. I've been trying different things I've found in
Google, but none have seemed to work yet. The parameters work in a Windows
environment, so I do believe the program is okay. This is on a SUSE/SLES 9
machine using WINE .917. If I want to pass the parameter
2011 Feb 17
2
Pre-allocation of matrices is LESS efficient?
Motivation: during each iteration, my code needs to collect tabular data (and use it only during that iteration), but the rows of data may vary. I thought I would speed it up by preinitializing the matrix that collects the data with zeros to what I know to be the maximum number of rows. I was surprised by what I found...
# set up (not the puzzling part)
x<-matrix(runif(20),nrow=4);
2013 Mar 13
2
merge datas
Hello all!
I have a problem with R. I try to merge data like this:
structure(c(2.1785, 1.868, 2.1855, 2.5175, 2.025, 2.435, 1.809,
1.628, 1.327, 1.3485, 1.4335, 2.052, 2.2465, 2.151, 1.7945, 1.79,
1.6055, 1.616, 1.633, 1.665, 2.002, 2.152, 1.736, 1.7985, 1.9155,
1.7135, 1.548, 1.568, 1.713, 2.079, 1.875, 2.12, 2.072, 1.906,
1.4645, 1.3025, 1.407, 1.5445, 1.437, 1.463, 1.5235, 1.609, 1.738,
1.478,
2018 Feb 25
4
reshaping column items into rows per unique ID
Hi All
I have a datafram which looks like this :
CustomerID DietType
1 a
1 c
1 b
2 f
2 a
3 j
4 c
4 c
4 f
And I would like to reshape this so I can
2001 Feb 08
1
ssh1 keyexchange problem ?
Hi,
Has anybody produced diffs for openssh-2.3.0p1 for the rsa keyexchange
problem that Core-SDI described ? ( I noticed that fix is already
in openbsd tree ).
-Jarno
--
Jarno Huuskonen - System Administrator | Jarno.Huuskonen at uku.fi
University of Kuopio - Computer Center | Work: +358 17 162822
PO BOX 1627, 70211 Kuopio, Finland | Mobile: +358 40 5388169