Displaying 20 results from an estimated 110 matches for "dat3".
Did you mean:
dat
2012 Jul 24
5
First value in a row
Hi.
This is likely a trivial problem but have not found a solution.
Imagine the following dataframe:
Lat Lon x1 x2 x3
01 10 NA NA .1
01 11 NA .2 .3
01 12 .4 .5 .6
I want to generate another column that consist of the first value in
each row from columns x1 to x3. That is
NewColumn
.1
.2
.4
Any input greatly appreciated,
Thanks,
Camilo
Camilo Mora, Ph.D.
2012 Oct 10
7
multiple t-tests across similar variable names
Hi everyone-
I have a dataset with multiple "pre" and "post" variables I want to compare. The variables are named "apple_pre" or "pre_banana" with the corresponding post variables named "apple_post" or "post_banana". The variables are in no particular order.
apple_pre orange_pre orange_post pre_banana apple_post post_banana
person_1
2009 Dec 17
4
Fishers exact test at < 2.2e-16
...n of Fisher?s exact test in
any package which can handle lower probabilities, or have other
suggestions as to how I can compare the probabilities?
I am for instance comparing the following two:
dat2<-matrix(c(29,0,29,0,12,0,18,0,0,29,0,16,0,19), nrow=2)
fisher.test(dat2, workspace=30000000)
dat3<-matrix(c(29,0,0,29,0,0,12,0,0,17,0,1,0,29,0,0,15,1,0,0,19),
nrow=3)
fisher.test(dat3, workspace=30000000)
Which both result in p-value < 2.2e-16
Kind regards, S?ren
2018 Jun 01
0
Time-series moving average question
...se questions, or perhaps suggest one of the other R-lists?
I have two questions:
1. Why am I getting this warning?
2. Why is the second example "Point Forecast" the same value, I do not see that in previous attempts with similar but different data sets as in example 1?
Example1:
dat3 <- structure(c(3539122.86, 3081383.87, 4158672.31, 4137518.78, 4123682.08, 4819375.2, 4342687.77, 5028674.58, 4472145.07, 4967277.73, 4516240.31, 4876194.63, 4816446.59,
4887399.37, 5478504.85, 4871385.27, 5487543.68, 5464193.69, 5252591.03, 7071416.89, 5524350.89, 6107166.69...
2012 Aug 11
3
help counting in data
Hi
>i have this data
> X
[1] 5.79 1579.52 2323.70 68.85 426.07 110.29 108.29 1067.60 17.05
22.66
[11] 21.02 175.88 139.07 144.12 20.46 43.40 194.90 47.30 7.74
0.40
[21] 82.85 9.88 89.29 215.10 1.75 0.79 15.93 3.91 0.27
0.69
[31] 100.58 27.80 13.95 53.24 0.96 4.15 0.19 0.78 8.01
31.75
[41] 7.35 6.50
2012 Jul 10
1
calculating the difference between days?
Hi List,
I have one column of beginning dates and one column of ending dates, I want
to find their difference. And I want to ignore the trailing zeros,
basically everything after the first colon mark.
Begin_date End_date
01JAN2000:00:00:00:000 02FEB2002:00:00:00:000
24MAR2012:00:00:00:000 18MAY2012:00:00:00:000
01OCT2003:00:00:00:000
2005 Jan 06
1
GLMM and crossed effects
...oss classified model using GLMM in lme4. I
have, for potential use, created a second coding of transect with
levels 1-5 for site 1 and 6-10 for site2. Likewise, if a groupedData
object is necessary, there are als ts1 and ts2 dummy variables, as was
necessary in the old lme.....
> str(dat3)
`data.frame': 100 obs. of 7 variables:
$ site : Factor w/ 2 levels "Here","There": 1 1 1 1 1 1 1 1 1 1 ...
$ day : Factor w/ 10 levels "1","2","3","4",..: 1 1 1 1 1 2 2 2 2 2
...
$ trans : Factor w/ 5 levels "1",...
2008 Sep 17
5
Loop on vector name
[My previous message rejected, therefore I am sending same one with some modification]
I have 3 vectors with object name : dat1, dat2, dat3
Now I want to create a loop, like :
for (i in 1:3)
{
cat(sd(dati))
}
How I can do this in R?
Regards,
2018 Jun 01
2
Time-series moving average question
My guess would be that if you inspect the output from
ma(dat3[1:28], order=3)
you will find some NAs in it. And then forecast() doesn't like NAs.
But I can't check, because I can't find the ma() and forecast() functions. I assume they come from some package you installed; it would be helpful to say which package.
-Don
--
Don MacQueen
Lawrence L...
2013 Feb 17
6
histogram
HI Elisa,
You could use ?cut()
vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45)
label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),function(i) paste(i[1],"<x<=",i[2],sep="")))
2012 Aug 01
3
Date period
Hello
I have dataframe
How to remove dates in hourly time seriesThe example time series likedate
value
2000-01-05 00:00:00 1.0
2000-01-05 01:00:00 1.0
2000-01-05 05:00:00 3.6
2000-01-05 06:00:00 3.6
2000-01-05 07:00:00 2.2
2000-01-05 08:00:00 2.2
2000-01-05 09:00:00 2.2
2000-01-05 10:00:00
2012 Mar 10
3
function input as variable name (deparse/quote/paste) ??
Hi all
Say I have a function:
myname=function(dat,x=5,y=6){
res<<-x+y-dat
}
for various input such as
myname(dat1)
myname(dat2)
myname(dat3)
myname(dat4)
myname(dat5)
how should I modify the 'res' line, to have new informative variable name
correspondingly, such as
dat1.res
dat2.res
dat3.res
dat4.res
dat5.res
stored in the workspace.
This is only an example of a complex function I have written.
Thanks in advance!
Casper...
2012 Oct 12
3
Columns and rows
Hi,
Could you please advice some easy way to do the following for a dataframe
(header=F) having unequal column- & row- length.
1. Combine/stack/join contents from -
a) multiple rows into one column.
b) multiple columns into one row.
2. Stack contents from multiple columns (or, rows) into one column (or,
row).
Thank you.
Cheers,
Santana
[[alternative HTML
2012 Aug 07
5
summing and combining rows
Hello,
I have a data set that needs to be combined so that rows are summed by a
group based on a certain variable. I'm pretty sure rowsum() or rowsums()
can do this but it's difficult for me to figure out how it will work for
my data based on the examples I've read.
My data are structured like this:
Plot SizeClass Stems
12 Class3 1
12 Class4
2012 Aug 16
8
How to extract from a column in a table?
Hi,
I have a table in which one column has the name of the objects as shown below.
Name
Budlamp-Woodcutter Complex - 15 to 60% slope (60/25/15)
Budlamp-Woodcutter Complex - 15 to 60% slope (60/25/15)
Terrarossa-Blacktail-Pyeatt Complex - 1 to 40% slope (40/35/15/10)
Terrarossa-Blacktail-Pyeatt Complex - 1 to 40% slope (40/35/15/10)
How can I split the single column into three columns
2012 Sep 01
5
R_closest date
Hi,
I have encountered an issue about finding a date closest to another date
So this is how the data frame looks like:
PT_ID IDX_DT OBS_DATE DAYS_DIFF OBS_VALUE CATEGORY
13 4549 2002-08-21 2002-08-20 -1 183 2
14 4549 2002-08-21 2002-11-14 85 91 1
15 4549 2002-08-21 2003-02-18 181 89 1
16 4549 2002-08-21 2003-05-15
2004 Nov 21
3
Help with ooplot(gplots) and error bars
...scription of the data:
> dat1
PointEst
TT1 1 3.6
TT2 2 5.0
TT3 3 5.8
TT4 4 11.5
TT5 5 7.5
TT5 6 8.7
TT7 7 17.4
> dat2
Lower
TT1 1 1.0
TT2 2 2.2
TT3 3 2.7
TT4 4 6.7
TT5 5 3.9
TT5 6 4.6
TT7 7 11.5
> dat3
Upper
TT1 1 12.3
TT2 2 11.2
TT3 3 12.1
TT4 4 19.1
TT5 5 14.2
TT5 6 15.6
TT7 7 25.6
> ooplot(dat1,type="barplot",col=rich.colors(7,"temperature"),names.arg=c("X","Y","Z","A","B","C","...
2012 Sep 24
3
List creation based on matrix
Hi guys,
It would be great if you could help me with this one...
I'm looking to create a script to convert a matrix of species abundance e.g:
<http://r.789695.n4.nabble.com/file/n4643978/species_matrix.jpg>
into two vectors e.g:
<http://r.789695.n4.nabble.com/file/n4643978/communitylist.jpg>
----------------
If you feel there is no easy answer to this and that it would be
2010 Jul 14
1
Write value to PHP webpage
...rently has the value ' ' as
a space holder. My code is currently:
# Loop through dataset, summarizing data based on Animal name
wild_ID <-unique(wild$ID)
Animal <-unique(wild$Name)
filepath <-"c:/Jared/Data/Kenya/Wildebeest/Summary/"
# Create an empty dataframe
dat3 <- data.frame(Animal)
for (i in c(1:length(wild_ID))) {
# Create Subset
dat <-subset(wild, ID == wild_ID[i])
# Calculate Sum of Movement, put in km
dat2 <-(sum(dat$STEPLENGTH))/1000
dat3$Distance[i] <-dat2
# Write Value to CSV file
outfile <-paste(filepath,"Animal_Dista...
2013 Apr 12
1
Removing rows that are duplicates but column values are in reversed order
...11
b???? a???????? 10
e????? c???????? 12
c????? e???????? 12
",sep="",header=TRUE,stringsAsFactors=FALSE)
?dat2[apply(dat2[,-3],1,function(x) {x1<- order(x); x1[1]<x1[2]}),]
?# id1 id2 value
#1?? a?? b??? 10
#2?? c?? d??? 11
#5?? c?? e??? 12
#or you have cases like these:
dat3<- read.table(text="
id1?? id2?? value
a????? b?????? 10
c????? d??????? 11
b???? a???????? 10
a????? b??????? 10
e????? c???????? 12
c????? e???????? 12
c????? d???????? 11
",sep="",header=TRUE,stringsAsFactors=FALSE)
?dat3New<-dat3[apply(dat3[,-3],1,function(x) {x1<...