Displaying 7 results from an estimated 7 matches for "subdat".
Did you mean:
subdata
2012 Jan 22
1
Problem with sapa package and spectral density function (SDF)
...nsity function is calculated without problems and with the monthly
series an error always occurs. The R script I'm using (and the error)
is:
> dat <- read.table("Lakes.txt",header=T)
> sub.dat <- subset(dat,dat$Name=="White")
>
> sub.dat$mf <- as.factor(subdat$Month)
> sub.dat$yf <- as.factor(subdat$Year)
> sub.dat$ymf <- subdat$yf : subdat$mf
> sub.datm <- aggregate(subdat$DA,list(subdat$ymf),mean)
>
> serie.day <- ts(subdat$DA,start(sub.dat$Year[1],sub.dat$Day[1],frequency=365))
> n.d <- length(serie.day)
> espec.day...
2010 Apr 24
1
Formatting numerical output
...put from a regression analysis. My code iteratively performs linear regression on a dataset while excluding certain data ranges.
My code:
rm(list = ls(all = TRUE))
sink("outfile")
dat <- read.table("testdat", sep="\t", header=TRUE)
int = 0.2
for (x in c(0:20)) {
subdat <- subset(dat, time <= int * x | time > (int*x) + int) #excludes range of time data between int * x and (int*x) + int
lm.subdat <- lm(length~time, subdat) #regression
rs.subdat <- summary(lm.subdat)$r.squared #getting R-squared information
txt1 <- ("Excluded...
2005 Jul 05
1
by (tapply) and for loop differences
...-value=
0.05245329
> tres = tapply(xvar, num, kindtest, yvar)
Mean xvar = 19.8904 Mean yvar = 21.97729 diff = 2.086891 p-value=
0.06222805
Mean xvar = 19.88329 Mean yvar = 21.97729 diff = 2.093996 p-value=
0.05245329
> detach(sdat,1)
## Results from for
> for(i in 1:2) {
+ subdat= subset(sdat, num==i)
+ kindtest(subdat$xvar, subdat$yvar)
+ }
Mean xvar = 19.8904 Mean yvar = 21.98615 diff = 2.095746 p-value=
0.07319223
Mean xvar = 19.88329 Mean yvar = 21.96843 diff = 2.085141 p-value=
0.05850057
OKAY - I'm going to brave and show you that I am still on version...
2006 Oct 19
1
Newbie: Selecting data
I've been working with R for all of about 8 hours, so anyone with more
experience than this should be able to help me. General comments about
my methods of work are also welcomed.
I have a table that I've imported thusly:
> w <- read.table("woodford.data", header=T)
> w
start therms gas KWHs elect temp days
1 10-Jun-98 9 16.84 613 63.80 75 40
2
2005 Apr 04
1
need any advises for code optimization.
Dear colleagues,
I have the following code. This code is to 'filter' the data set.
It works on the data frame 'whole' with four numeric columns: a,b,d, and c.
Every row in the data frame is considered as a point in 3-D space.
Variables a,b, and d are the point's coordinates, and c is its value.
This code looks at every point, builds a cube 'centered' at this
2006 Jun 28
5
sapply question
sent this to the list yesterday but didn't see it listed in the daily
summary ... apologies if you receive it
twice ...
________________________________
From: Afshartous, David
Sent: Tuesday, June 27, 2006 10:02 AM
To: 'r-help@stat.math.ethz.ch'
Subject: sapply question
All:
I'm trying to use sapply to break up data within another function.
(tapply doens't seem to work
2010 Dec 30
1
data frame subset too slow
...ns (for example, same first column with another dataset etc...).
Here is how I did it:
# import data
dat <- read.table( "test.txt", header=TRUE, fill=TRUE, sep="\t" )
list <- read.table( "list.txt", header=TRUE, fill=TRUE, sep="\t" )
# create sub data
subdat <- dat[dat[1] %in% list[1],]
So the third line is to create a new data frame with all the same first
column in both dat and list. There is no problem with the code as it
runs just fine with testing data (small). When I tried with my real data
(~80k lines, ~ 15MB size), it takes like forever...