Displaying 20 results from an estimated 10000 matches similar to: "can not read a table"
2012 Nov 21
4
help with if statement
Hi all,
I had a dataset A like:
TIME DV
0 0
1 10
5 20
24 30
36 80
48 60
72 15
I would like to add 24 to those values higher than 24 in the TIME column.
I did the following:
If (A$TIME>=24) {
A$TIME <- A$TIME+24}
It did not work. How should I do it?
Thanks,
--
View this message in context: http://r.789695.n4.nabble.com/help-with-if-statement-tp4650315.html
Sent from the
2012 Jul 16
2
extract number from a mixture of character and number
Hi, all,
I have a column like the following:
ID TIME
sub_001 0
sub_001 24
sub_002 0
sub_002 24
sub_003 0
sub_003 24
sub_004 0
sub_005 24
..
..
is there a way for me to just
2012 Jun 20
3
data normalization
I have a dataframe such like the following:
ID TIME DV
1 0 0.880146038
1 1 0.88669051
1 3 0.610784702
1 5 0.756046666
2 0 0.456263368
2 1 0.369991537
2 3 0.508798346
2 5 0.441037014
3 0 0.854905349
3 1 0.960457553
3 3 0.609434409
3 5 0.655006334
. . .
. . .
I would like to generate another column with the normalized values of DV.
for each ID, normalize to the value at TIME 0.
I was able to
2004 Aug 25
1
brlr function
Hi,
I'm trying the brlr function in a penalized logistic regression function.
However, I am not sure why I am encountering errors. I hope to seek
your advice here. (output below)
Thank you! Your help is truly appreciated.
Min-Han
#No error here, the glm seems to work fine
>
2008 Jul 14
2
Backslash in sub pattern?
Dear guRus,
I am trying to replace "~" by "$\sim$" for TeX. However, I can't get the
backslash to work. I would like to turn "DV~IV" into "DV$\sim$IV".
sub("~","$\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\sim$","DV~IV") => "DV$sim$IV"
2013 Mar 08
4
Substitute value
Hi,
I have a large data frame and within this there is one column which contains
individual codes (eg. 1.1234.2a.2). I am splitting these codes into their 4
components using strsplit (eg. "1", "1234", "2a", "2"). However there are
some individual codes which do not have a last component (eg. 2.4356.3b. ),
I want to give these codes a "1" as their
2008 May 30
2
Including a tilde in a plotmath-type call
Suppose I have a plot
plot(1:10, pch = "")
And I want some text to indicate a Normal distrubition. I could do
this:
text(5, 6, substitute(X~~~~N(mu, sigma^2)), adj = 0)
text(5.35, 6, "~", adj = 0)
But that's clumsy, and depending on your plotting device, might not even look
sensible. I'd prefer to be able to do it more directly and
simply the way these do:
text(5,
2010 Oct 20
3
Plot help
Dear List,
I am relatively new to R and am trying to create more attractive plots than excel can manage!
I have looked through the various programmes ggplot, lattice, hmisc etc but my case seems to be not metnioned, maybe it is but i have not noticed - if this is the case i apologise.
2019 May 15
1
domain still running although snapshot-file is deleted !?!
Hi,
i have a strange situation:
A domain is still running where domblklist points to a snapshot file and also dumpxml says the current drive is that snapshot file.
But the file has been deleted hours ago. And the domain is still running. I can login via ssh, the database and the webserver are still running,
domain is performant.
How can that be ?
Also lsof shows that the file is deleted:
2005 Apr 13
1
i param in "for" loop does not takes zeros?
Hi all
Is there any reason why the parameter i in a "for" loop ignores a value of
zero? For example
sim=c()
p=.2
for(i in 0:5)
{sim[i]=dbinom(i,5,p)
}
sim
[1] 0.40960 0.20480 0.05120 0.00640 0.00032
In this example the quantile i= 0 was ignored since
dbinom(0,5,p)
[1] 0.32768
The same behaviour occurs if I use a while loop to perform the same
calculation:
sim=c()
p=.2
i=0
2006 Jan 13
1
Variance-covariance by factor
Dear all,
I have a data frame with one factor and four numeric variables and
wish to obtain the var-cor matrix separately by factor. I tried by() and
sapply() but getting nowhere. I understand this can be done by subsetting
the dataframe, but there should have some sleek ways of doing it.
Here is a simulated dataframe;
s <- rep(c("A","B","C"), c(25,22,18))
d
2006 Oct 08
1
Simulate p-value in lme4
Dear r-helpers,
Spencer Graves and Manual Morales proposed the following methods to
simulate p-values in lme4:
************preliminary************
require(lme4)
require(MASS)
summary(glm(y ~ lbase*trt + lage + V4, family = poisson, data =
epil), cor = FALSE)
epil2 <- epil[epil$period == 1, ]
epil2["period"] <- rep(0, 59); epil2["y"] <- epil2["base"]
2007 Jul 14
3
How to read many files at one time?
I want to load many files in the R. The names of the files are "Sim1.txt", "
Sim2.txt", "Sim3.txt", "Sim4.txt", "Sim5.txt" and so on.
Can I read them at one time? What should I do? I can give the same names in
R.
Thanks.
For example:
> tst=paste("Sim",1:20,".txt",sep="") # the file names
> tst
[1]
2006 Feb 27
1
Different deviance residuals in a (similar?!?) glm example
Dear R-users,
I would like to show you a simple example that gives an overview of one
of my current issue.
Although my working setting implies a different parametric model (which
cannot be framed in the glm), I guess that what I'll get from the
following example it would help for the next steps.
Anyway here it is.
Firstly I simulated from a series of exposures, a series of deaths
(given a
2011 Dec 07
1
using sample
Hi,
Can anyone help sort out the problem with the following script - I am a R
newbie and I am self taught.
obs.all = c()
for(i in 1:386){
if (n.sim[i]>0){
obs = (1:133429)[event.details[,2] == i]
obs.all = c(obs.all, sample(obs[obs < n.sim[i]], size = n.sim[i],
replace=T))
}
Basically, in the sample bit, I only want to get obs.all if the value of
2004 May 24
1
Null model for arima.sim().
In some time series simulations I'm doing, I occasionally want the
model to be ``white noise'', i.e. no model at all. I thought it
would be nice if I could fit this into the arima.sim() context,
without making an exceptional case. I.e. one ***could*** do
something to the effect
if(length(model)==0) x <- rnorm(n) else x <- arima.sim(model,n)
but it would be more suave if one
2005 May 26
1
PAN: Need Help for Multiple Imputation Package
Hello all. I am trying to run PAN, multilevel
multiple imputation program, in R to impute missing
data in a longitudinal dataset. I could successfully
run the multiple imputation when I only imputed one
variable. However, when I tried to impute a
time-varying covariate as well as a response variable,
I received an error message, “Error: subscript out of
bounds.” Can anyone tell if my commands
2014 Apr 14
2
Read.table mucks up headers
Hey All
I am trying to read in a small text file using read.table.
dput(sim)
structure(list(ï...X. = 1:7, Y1 = c(2.5501, 4.105, 5.4687, 7.0009,
8.5066, 9.785, 11.5167), Y2 = c(2.5501, 4.105, 5.4687, 11.0009,
8.5066, 9.785, 11.5167), Y3 = c(2.5501, 4.105, 5.4687, 7.0009,
8.5066, 9.785, 15.5167)), .Names = c("ï...X.", "Y1", "Y2", "Y3"
), class =
2008 Aug 01
5
drop1() seems to give unexpected results compare to anova()
Dear all,
I have been trying to investigate the behaviour of different weights in
weighted regression for a dataset with lots of missing data. As a start
I simulated some data using the following:
library(MASS)
N <- 200
sigma <- matrix(c(1, .5, .5, 1), nrow = 2)
sim.set <- as.data.frame(mvrnorm(N, c(0, 0), sigma))
colnames(sim.set) <- c('x1', 'x2') # x1 & x2 are
2005 Oct 10
1
using innov in arima.sim
Hello,
I have used the arima.sim function to generate a lot of time series, but to day I got som results that I didn't quite understand. Generating two time series z0 and z1 as
eps <- rnorm(n, sd=0.03)
z0 <- arima.sim(list(ar=c(0.9)), n=n, innov=eps)
and
z1 <- arima.sim(list(ar=c(0.9)), n=n, sd=0.03),
I would expect z0 and z1 to be qualitatively similar. However, with n=10 the