Displaying 20 results from an estimated 1000 matches similar to: "RE : Create sequence for dataset"
2004 Dec 14
2
Re : Save result in a For Loop
Hiya,
I have been struggling to save the result from the FOR loop. What is the
best way to do it, as I need the result to merge with another dataset for
further analysis ?
for (dd in ((M-10):M)){
+ dist<-(32-dd)
+ r<-1/2*(1-exp(-2*dist/100))
+ map<-c(dd,round(r,4))
+ print(map)
+ next
+ }
Thanks. Stella
___________________________________________________________________________
This
2004 Dec 06
2
Re : LOOPS
Dear lists,
I want to construct a loop in R, but don't know how to do it. I can do it
in SAS, but I prefer in R (which I am hoping I will off SAS for good
soon). Could anyone help me to convert the SAS codes to equivalent R codes.
Basically, the following codes were written to establish the sire gametes
or phases for daughter design for one markers two alleles.
Here are the SAS code:
do
2005 Jan 04
4
Re : Frequency count
Dear list,
I have a dataset as follow and I would like to count the frequencies for
the combination of the two variables (f1 and f2) for each id. I know it is
should be straight forward, but I just don't know how to do it in R. Here
is the SAS code I will use to get the output I want :
proc means nway;
class id f1 f2;
var flag
output out=temp;
Dataset:
id f1 f2 flag
798 1 2
2005 Oct 18
1
Re : Seperate timestamp data into date and time
Dear R list,
I am reading in text file data prepared in Access database by someone. One
of the field contains timestamp data, how can I separate the timestamp data
into two varaibles: date and time. Can I specify the field is in timestamp
format when I first reading in ?
My reading in data are as below:
449 LWT 22/10/2003 15:43:00 441 143
449 LWT 17/11/2003 15:25:00 421 169
449 LWT
2009 May 26
2
Problem accessing "row number" from subset on a dataframe
I would like to use the "row number" information returned from performing a subset command on a dataframe.
For example, I would like to automatically delete some rows from a dataframe if they match a criteria. Here is my example below.
data(airquality)
names(airquality)
subset(airquality, airquality$Month == 6)
Now how do I delete the row numbers returned automatically?
I
2009 Aug 04
5
Stacked plots with common x-axis and different y-axis
Is there a place that shows how to create two plots that are stacked on top of each other where they share a common x-axis scale, but have differnt y-axis scale?
Say have the following data: airquality
Stack plot(airquality$Day, airquality$Wind) on top of plot(airquality$Day, airquality$Temp).
I am interested in stacking the two on top of each other with no seam, or plotting the two lines with
2008 Dec 23
3
Using transform to add a date column to a dataframe
I would like to add a column to the airquality dataset that contains the date
1950-01-01 in each row. This method does not appear to work:
> attach(airquality)
> data1 <- transform(airquality,Date=as.Date("1950-01-01"))
Error in data.frame(list(Ozone = c(41L, 36L, 12L, 18L, NA, 28L, 23L, 19L, :
arguments imply differing number of rows: 153, 1
I can't decipher what
2006 Feb 05
2
a generic 'attach'?
Is there any reason why 'attach' is not generic in R?
I notice that it is in another system, for example, and I can see some
applications if it were so in R.
Bill Venables.
Bill Venables,
CMIS, CSIRO Laboratories,
PO Box 120, Cleveland, Qld. 4163
AUSTRALIA
2007 Aug 25
1
Theora vs MPEG vs H264
Hi all,
I have to compare the theora codec with MPEG and H264.
I was googling and I found that the PSNR is a common used parameter.
How can I do this with Theora?
Thanks
--
Leonardo de Paula Rosa Piga
Undergraduate Computer Engineering Student
LSC - IC - UNICAMP
http://www.students.ic.unicamp.br/~ra033956
2005 Jul 01
2
Simple indexing conundrum
My apologies in advance for my thickness but I can't seem to solve the
following, seemingly simple, data manipulation problem:
I have a data frame that contains multiple factors and multiple
continuous response variables, but duplicates of some factor
combinations. The duplicates contain bad data, so I would like to
eliminate the duplicates. I would like to retain the entire rows
2002 Sep 05
1
rcorr in Hmisc
Dear list,
I get the following message when I use rcorr in library "Hmisc"
------------------------------------------------------
> rcorr(lskPox0t30, type=c("spearman"))
Error in "[<-.data.frame"(*tmp*, is.na(x), value = 1e+30) :
matrix subscripts not allowed in replacement
------------------------------------------------------
I do not understand
1999 Aug 24
3
Error in get(x, envir, mode, inherits)
Dear R list,
members of my course have encountered the following error message:
> slm <- lm(price ~ engsize, autoframe)
Error in get(x, envir, mode, inherits) : variable "FUN" was not found
[more context is given in the fuller listing below].
Once the error is encountered it seems to persist; for example early in one
session:
> summary(blin.fit)
Call:
lm(formula = Response
2007 Apr 01
1
Non-unique column names in data frames
Dear r-devel members,
It's just been brought to my attention that R permits non-unique column
names in data frames -- e.g., via assignment to names() or colnames(). This
behaviour is consistent with the help files (as I discovered), but it's not
consistent with the behaviour of rownames() and row.names(). For example,
row.names(airquality) <- rep("a", nrow(airquality))
2008 May 05
4
Column renaming
Dear all,
Is there a less cumbersome way to rename a column by name (as opposed
to index) than --
names( X)[ names[ X] == "bob"]<-"sue"
?
A semi-related question: how does one get the index of a column by
name, something along the lines of col.index( X, "sue") ?
Chip Barnaby
---------------------------------------------------------
Chip Barnaby
2012 Feb 23
1
Sexpr not getting expanded in Sweave
An Sweave file, 'test.Rnw':
\documentclass{article}
\title{Sweave minimal}
\author{MK}
\begin{document}
\maketitle
We try Sweave:
<<1>>=
data(airquality)
summary(airquality)
x <- airquality[1, 1]
@
I try Sexpr: \Sexpr{x}
We plot:
\begin{center}
<<2, fig=TRUE, echo=FALSE >>=
boxplot(Ozone ~ Month, data = airquality)
@
\end{center}
\end{document}
I check the
2013 Jul 23
1
cbind error with check.names
Here is an example where?cbind?fails with an error when?check.names=TRUE?is set.
data(airquality)
airQualityBind =cbind(airquality,airquality,check.names =TRUE)
?I understand that?cbind?is a call to?data.frame?and the following works:
airQualityBind =data.frame(airquality,airquality,check.names =TRUE)
but I would like to understand why?cbind?throws an error.
I asked this question on SO here:
1998 Feb 16
1
R-beta: Various R Questions and Comments
A non-text attachment was scrubbed...
Name: not available
Type: text
Size: 5982 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/19980216/81b069c2/attachment.pl
2017 Jun 26
2
Odd behaviour in within.list() when deleting 2+ variables
The behaviour of within() with list input changes if you delete 2 or more variables, compared to deleting one:
l <- list(x=1, y=2, z=3)
within(l,
{
rm(z)
})
#$x
#[1] 1
#
#$y
#[1] 2
within(l, {
rm(y)
rm(z)
})
#$x
#[1] 1
#
#$y
#NULL
#
#$z
#NULL
When 2 or more variables are deleted, the list entries are instead set to NULL. Is this intended?
2010 Jan 24
2
How to define degree=1 in mgcv
Hi, all
I have a question on mgcv and ns. Now I want to compare the results from
glm, gam and ns. Take a simple model y~x for example.
glm1 = glm(y~x, data=data1)
gam1 = gam(y~s(x), data=data1)
ns1 = glm(y~ns(x),data=data1)
In order to confirm the result from glm1 is consistent to those from gam1
and ns1, I want to define degree=1 in mgcv and ns. I am wondering if there
is somebody can give me
2007 Sep 16
1
Identifying objects from a data set
Hello
Given the following data for a data set called airquality. To identify the nature of the objects from the data set airquality example "Ozone" would it be best to use the command is. like is.character(airquality$Ozone) ....... I tried attributes(airquality$Ozone) but it came up null. Would there be a better way to identify these objects.
Thanking you in advance for your