This struck me as incorrect:
> choose(3.99, 4)
[1] 0.979
> choose(3.999, 4)
[1] 0
> choose(4, 4)
[1] 1
> choose(4.001, 4)
[1] 4
> choose(4.01, 4)
[1] 1.02
Should base::choose(n, k) check whether n is within machine precision of k and
return 1
function." But clearly the result is
different in each case.
If the help for as() is correct, then as(1:10, "numeric") should also return
doubles, and the second argument is not ignored.
Erik
> On Feb 1, 2016, at 8:16 AM, Franklin Bretschneider wrote:
>
> Dear Erik
Methods are pre-defined for coercing any object to one of the basic datatypes.
For example, as(x, "numeric") uses the existing as.numeric function."
Thanks,
Erik
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https:
nd(s$sma50.new, cumsum(s$sma50.new))
chart.CumReturns(returns.new,s$sma50.new,geometric=F)
Erik Schiele
Vice President
Money Markets Trading, Originations and Sales
101 Barclay St, NY NY 10007 3rd Floor
BNY Mellon Capital Markets, LLC
Main Desk 212-815-8222
This is for informational purposes only
Hi,
Did you ever get an answer about this? It has been so so frustrating for
me...
Thanks!
On Sunday, March 22, 2015 at 11:29:28 PM UTC-4, Vindoggy ! wrote:
>
> I'm using a mac with OSX Yosemite (10.10.2), running the latest version of
> R (3.1.3). But I've been having this same issue since
aset:
agegrp <-
c("<1","1-4","5-14","15-24","25-34","35-44","45-54","55-64","65-74","75-84","84-")
y1994 <- c(0,5,7,9,25,44,23,32,40,36,8)
y1995 <- c(2,4,1,7,20,39,32,
time around?
Thanks in advance,
Erik
make output:
...
gcc -std=gnu99 -I../../src/extra/zlib -I../../src/extra/bzip2
-I../../src/extra/pcre -I../../src/extra -I../../src/extra/xz/api -I.
-I../../src/include -I../../src/include -I/usr/local/include
-DHAVE_CONFIG_H -g -O2 -c vfonts.c -o vfonts.o
It works, thanks a lot Gabor
Erik
--
View this message in context:
http://r.789695.n4.nabble.com/Find-all-duplicate-records-tp3865139p3867724.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https
It worked, thank you Jim
Erik
--
View this message in context:
http://r.789695.n4.nabble.com/Keep-ALL-duplicate-records-tp3865136p3867709.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https
04:44
preferably by returning logical values (TRUE FALSE TRUE FALSE)
Is there a simple way to do that?
[-- With duplicated(df$ID) the output will be
[1] FALSE FALSE TRUE FALSE
i.e. not all user A records are found
With unique(df$ID)
[1] userA userB userC
Levels: userA userB userC
i.e. one of ea
ros, and
matrix b is a dense 750,000 by 1 matrix. Does an R function exist for solving
the non-negative least squares problem with a sparse matrix?
Thanks!,
Erik
> sessionInfo()
R version 2.13.0 (2011-04-13)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF
e
"incorrect", but maybe i'm somehow misinterpreting the plot!)?
Thank you for your time."
There has been no answer other than that I ought to contact the package
maintainer. Since it would be nice to have a publicly displayed solution, I
opted to post here first before doing
t; and steps on the margin a bit.
- erik
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
ta1.contents
Also meant to mention to see ?describe in the Hmisc package:
E.g.,
> describe(c(NA, 1:10))
There is also a useful method for data.frame objects.
--Erik
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLE
ion(x) sum(!is.na(x)))
NB: none of this is tested!
--Erik
Ultimately, I would like for this to be 1 conponent in a larger function
that will produce PROC CONTENTS style output. Something like...
data1.contents<-data.frame(Variable=names(data1),
Class=sapply(data1,class),
n.valid=s
On 04/07/2011 07:55 PM, Rolf Turner wrote:
On 08/04/11 12:40, Erik Iverson wrote:
On 04/07/2011 07:32 PM, Rolf Turner wrote:
On 08/04/11 12:22, Erik Iverson wrote:
Rolf,
What does
capabilities("tcltk")
return?
FALSE
I believe R needs to be compiled with tcltk support for the
On 04/07/2011 07:32 PM, Rolf Turner wrote:
On 08/04/11 12:22, Erik Iverson wrote:
Rolf,
What does
> capabilities("tcltk")
return?
FALSE
I believe R needs to be compiled with tcltk support for the package to work. Do
you compile your own version or use a package manager (e.
Rolf,
What does
> capabilities("tcltk")
return?
On 04/07/2011 07:15 PM, Rolf Turner wrote:
Perhaps I'm being even thicker than usual, but I can't find
the tcltk package on CRAN. There is a tcltk2 package, which says
that it is a collection of supplements to tcltk, but I cannot
see a just-pla
jim holtman wrote:
They are probably the same. It isjust that summary is printing out 4
significant digits. Try:
options(digits = 20)
FYI, the default summary method also has its own digits argument.
On Tue, Apr 5, 2011 at 12:38 PM, Daniel Malter wrote:
Hi,
I summary() a variable w
Holly,
try
> length(unique(x)) == 1
where x is your vector of interest. But think about
how you want NA values to be treated, and also think about
R FAQ 7.31 if dealing with floating point numbers.
--Erik
Beale, Holly (NIH/NHGRI) [F] wrote:
Is there a less cryptic way to compare three
See:
http://en.wikipedia.org/wiki/Coefficient_of_determination#Adjusted_R2
and the implementation in summary.lm :
ans$adj.r.squared <- 1 - (1 - ans$r.squared) * ((n -
df.int)/rdf)
Brian Smith wrote:
Hi,
Sorry for the naive question, but what exactly does the 'Adjusted R
Jonas,
Try looking at the tikzDevice package, and/or
the pgfSweave package.
--Erik
Jonas Stein wrote:
Hi,
i want to make my plots look uniform in LaTeX documents.
- usage of the same font on axes and in legend like LaTeX uses
(for example "Computer Modern")
- put real LaTeX f
John,
as.data.frame is a generic function that will call different methods
depending on what class of object you pass to it. The different
methods may have different arguments that they expect or honor.
The stringsAsFactors parameter is only used in certain methods of
as.data.frame. When you p
Gene, it's described in ?NumericConstants
HTH, Erik
Gene Leynes wrote:
I've been wondering what L means in the R computing context, and was
wondering if someone could point me to a reference where I could read about
it, or tell me what it's called so that I can search for it
Is this what you mean?
z[which(z[,"x"] == 5) - 1, "y"]
?which is probably what you're looking for...
Hongwei Dong wrote:
Hi, R users,
I'm wondering if I can identify an element in a column by an element in
another column. For example:
x<-1:10
y<-11:20
z<-cbind(x,y)
z
x y
[1,] 1 11
[
complete.cases useful.
Also try:
sum(!is.na(o$m))
?tapply may also be useful in general: e.g.,
tapply(o$m, o$n, mean, na.rm = TRUE)
None of this is tested...
hope this explains, what I need to know.
Thanks,
S.
Am 22.02.2011 16:50, schrieb Erik Iverson:
Sandra,
Please provide a small
Sandra,
Please provide a small, reproducible example of this issue.
You probably want to use ?is.nan and not the inequality
operator.
Similar example, contrast:
x <- NA
is.na(x)
x == NA
Sandra Stankowski wrote:
Hey there,
I tried to count the number of rows, where my data isn't NaN in a
cer
Gene,
?rapply is a recursive version of ?lapply, and should work.
rapply(masterlist, function(x) x*NA, how = "replace")
--Erik
Gene Leynes wrote:
Hello all,
Maybe I'm being thick, but I was trying to figure out a simple way to create
a list with the same dimension of an
LaTeX document.
--Erik
Julia Jacobson wrote:
Hello R users,
Using R, Sweave and the cmsyase.afm font it is possible to write LaTeX
documents including R figures with text in the Computer Modern Fonts:
\documentclass{article}
\usepackage{Sweave}
\begin{document}
<>=
CM <- Type
uation when I have data that differ
between the common names in the two data.frames. You might try the "by"
argument in merge...
Best.
--Erik
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the p
Mark Knecht wrote:
Title asks it all.
Thanks in advance,
Mark
a = 1:5
b1 = 2:6
Z = data.frame(a,b1)
Z
Z$b1
count = 1
MyName = paste("b",count,sep="")
MyName
Z$MyName
Z[[MyName]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailma
koooee wrote:
is this the expected behavior of as.character ?
resultset is a data.frame from a sqlQuery() using RODBC
a = as.character(as.vector(resultset[1]))
a
[1] "c(-1, 1, 2, 3, 4, 5, 6, 7, 8, 9)"
I would expect the statement above to return similar to the result below, am
I missing so
H Roark wrote:
I have a data set covering a large number of cities with values for
characteristics such as land area, population, and employment. The problem I
have is that some cities lack observations for some of the characteristics and
I'd like a quick way to determine which cities have m
being done in ?rbind,
and you should read the help for that, particularly under "Data frame
methods". You can also study the code of base.rbind.data.frame to see
what it's actually doing.
--Erik
__
R-help@r-project.org mailing list
h
?tapply would be one way to get the max for all
conditions at once.
Your example is not reproducible, so I cannot give you a
reproducible answer, but adapt the following:
tapply(df$responce, df$condition, max)
A. Ramzan wrote:
Hello
I am trying to find a way to find the max value, for only
I am trying to create a function that is able to calculate this sum:
a<-c(2,3,5)
b<-(8,7)
with "a" meaning 235 and "b" 87. So the result of this sum would be 235 + 87
= 322.
a <- c(2,3,5)
b <- c(8,7)
vectorToScalar <- function(x) {
as.numeric(paste(x, collapse = ""))
}
vectorToScalar(a)
f that list as the arguments, then ?do.call is what
you need.
a <- list("example", "of", "do.call")
#compare the two following expressions
paste(a)
do.call(paste, a)
--Erik
__
R-help@r-project.org mailing list
https://stat
http://crantastic.org/
On 01/24/2011 09:08 PM, zubin wrote:
We should really have an R package rating site, comments, reviews or
such, like folks do for apps or movie reviews. Does anyone know of a
site trying to do this. If i remember correctly a few R user
conferences ago this was talked abo
Roy Mathew wrote:
Thanks for the reply Erik, As you mentioned, grouping consecutive
elements of 'a' was my idea.
I am unaware of any R'ish way to do it. It would be nice if someone in
the community knows this.
Is this the idea you're trying to execute? It uses ?rle
Roy,
I have no idea what you're actually trying to do here, but
it looks like there would be a more natural R'ish way if
you're concerned about grouping consecutive elements of 'a'.
At any rate, within your while loop, you're incrementing n by
1, and eventually n will be 10, which will be transf
Joe P King wrote:
So many matrices are square symmetrical (i.e. variance-covariance matrices),
is there any way to get R to split the matrix on its diagonal and just
return one diagonal?
mat<-matrix(c(1,4,3,4,1,2,3,2,1), nrow = 3, ncol=3, byrow=TRUE)
is there anyway to get the lower rig
Hello,
I have a data set of data which is best fit by an exponential decay
function. I would like to use a nonlinear weighted least squares regression.
What function should I be using?
Thank you!
[[alternative HTML version deleted]]
__
R-help
Silvano wrote:
Hi,
I used subset command, like this:
grupoP = subset(dados, grupos=='P', select=c(mortos, vivos, doses,
percevejos, p))
and the variables in select option are numeric.
They may *look* numeric, but are they really? You don't give us
enough information to determine that.
2)
a b c
2 4 6
> pick(test, 3)
a b c
NA NA 7
> pick(test, 4)
a b c
NA NA NA
-Erik Gregory
Student Assistant, California EPA
CSU Sacramento, Mathematics
- Original Message
From: Greg Snow
To: Jannis ; "r-help@r-project.org"
Sent: Wed, January 12, 2011 1:17:54
t need to see the output of the R script in the
python console. If you really want to see that, have R write the output into
some file that python can open and open that with python script! I did all
this
without any experience with python (I'm alright with R), so you may even find
some short
Does the prtest argument help when you actually use the 'print' function
around your summary.formula object? I think that's how I
solve it.
I.e.,
sf1 <- summary(trt~sex+ascites,data=ex,test=T,method="reverse",catTest=u)
print(sf1, prtest = "P")
Descriptive Statistics by trt
+---+---+
The closest I get is
u<-function(a,b){
j<-fisher.test(a)
p<-list(P=j$p.value,stat=1,df=1,testname=j$method,statname="")
return(p)
}
However then I manually have to edit the output. Is there a smart way of doing
this?
You're not explaining
Is this a capability that R has as a language? Unfortunately, I'm unfamiliar
with html or php programming, so if this question belongs in a forum on that I
apologize. I'm trying to centralize all of my code for my analysis in R!
Thank you,
-Erik Gregory
Student Assistant, Cali
1
Jon Erik Ween, MD, MS
Scientist, Kunin-Lunenfeld Applied Research Unit
Director, Stroke Clinic, Brain Health Clinic, Baycrest Centre
Assistant Professor, Dept. of Medicine, Div. of Ne
able to do that - even if I can use a local repo.
Any ideas?
Thanks in advance
Erik
On 12/14/2010 06:17 PM, Mike Marchywka wrote:
( hotmail just randomly decides not to prefix original text, my comments below)
Date: Tue, 14 Dec 2010 17:36:11 +010
Hi there,
I have the following problem and I hope somebody might help me.
First of all: I am using WinXP SP3 (english and/or german) with R in
Version 2.10.0.
Now I am trying to install some packages but unfortunately I am getting
a weird error. No matter which package I am trying to install
Please provide a reproducible example!
E.g., use ?dput to dump a minimal data.frame that
exhibits this issue on the newest version of R.
Justin Fincher wrote:
Howdy,
I have written a small function to generate a simple plot and my
colleague is having an error when attempting to run it. Esse
all object that the
parser would not make).
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Erik Iverson
Sent: Monday, December 13, 2010 12:17 PM
To: R-help
Subject: [R] Does
Hello,
Does anyone know of a function that will determine whether
or not a formula object has a left hand side?
I.e., can differentiate between
y ~ x + z
and
~ x + z
Perhaps I'm overlooking the obvious...
Thanks!
__
R-help@r-project.org mailing l
On 12/13/2010 07:14 AM, Özgür Asar wrote:
Dear Researchers,
I am looking for to read a SAS macro in R. Although I searched it on web, I
couldn’t find anything.
Are you hoping just to read it in, or to actually have it
execute the macro as SAS would?
What gives you the idea the latter is ev
On 12/11/2010 04:48 PM, Tal Galili wrote:
Hello dear R-help mailing list,
My question is *not* about how factors are implemented in R (which is, if I
understand correctly, that factors keeps numbers and assign levels to them).
My question *is* about why so many functions that work on factors don
Does the following help?
A = c("A\\nB", "C\\nD")
test <-data.frame(A)
#access levels directly to change names
levels(test$A) <- sub("n", "\n", levels(test$A))
#re-order levels of the factor
test$A <- relevel(test$A, "C\nD")
Rob James wrote:
I am trying to reorder a factor variable that ha
is then
translated into a z-score in a second table. My DSTz table combines these two
steps, going from the raw score to the tabulated age-adjusted z-score that was
calculated based on a normative sample by the WMS-R folks.
Jon
Soli Deo Gloria
Jon Erik Ween, MD, MS
Scientist, Kunin-Lunenfeld
One way:
as.vector(t(cbind(ColA, ColB)))
Ross, Stephanie wrote:
Hello,
I have a general formatting question. I have two columns of data:
ColA <- c("m", "m", "m", "m")
ColB<- c("d","d","d","d")
And I would like to reorder them into a new column that looks like this:
ColC<- c("m","d","m","d",
mailto:r-help-boun...@r-project.org] On Behalf Of Jon Erik Ween
>> Sent: Thursday, December 09, 2010 8:27 AM
>> To: David Winsemius
>> Cc: r-help@r-project.org
>> Subject: Re: [R] set dataframe field value from lookup table
>>
>> Sorry, I should have included
object length is not a multiple of shorter object length
So, regardless of how you calculate [r,c], the step
df$DSTz<-DSTzlook[r,c]
doesn't work. I've tried various permutations with "apply", but that didn't
work either. Any suggestions?
Jon
Soli Deo Gloria
Jon Eri
But it is the indirect referencing of the lookup in the main table that causes
me trouble.
Jon
Soli Deo Gloria
Jon Erik Ween, MD, MS
Scientist, Kunin-Lunenfeld Applied Research Unit
Director, Stroke Clinic, Brain Health Clinic, Baycrest Centre
Assistant Professor, Dept. of Medicine, Div. of Neu
.8 2.6 2.6
27 0.0 0.5 1.0 1.8 2.6 2.6
26 -.5 0.0 0.0 1.0 1.8 2.6
.
.
.
.
So, if a subject (row) has age==29 and a standard score of 28, the value should
be 1.8, etc.
Thanks
Jon
Soli Deo Gloria
Jon Erik Ween, MD, MS
Scientist, Kunin-Lunenfeld Applied Research Unit
Director, Strok
Hi
This is (hopefully) a bit more cogent phrasing of a previous post. I'm
trying to compute a z-score to rows in a large dataframe based on values in
another dataframe. Here's the script (that does not work). 2 questons,
1) Anyone know of a more elegant way to calculate the "rounded" age value
t
Hi!
I have a large dataset where I need to recompute a value in each row based
on z-sores from another look-up table. The look-up table is arranged by raw
score in the first column and age in the first row, eg:
20 30 40
1 .3 .5 .7
2 .2 .3 .4
3 .1 .4 .7
the main matrix will have ages
project, at http://orgmode.org . Org-mode will let you write
content and embed code in dozens of languages, including R, that can be
exported to PDF, HTML, DocBook, and others all simultaneously. It is thus
an alternative to Sweave, although conceptually similar. Org-mode can
also be used as
Phil Spector wrote:
Jahan -
Try
dat$target = toupper(dat$target)
Note that in this case, the above *will* coerce dat$target
to a character vector, which may or may not be what
is intended.
__
R-help@r-project.org mailing list
https://stat.ethz
vels' associated with them,
which can be queried with the ?levels function.
'Behind the scenes', R is storing this variable
as numeric codes, not the character string associated
with each numeric code.
This contrasts with character vectors.
--Erik
Jahan wrote:
Hello,
Here is
detailed explanation about this? Thanks in
advance!
Yes, R gives the global variable ncol a value of 4. Try typing
> ncol
before and after your example.
The second argument to the matrix function is now the value 4, and R uses
positional matching to give that argument (nrow) a value of 4. Thus
, 8))
See ?lapply and ?mapply, and the MoreArgs and
SIMPLIFY arguments to mapply.
--Erik
Edwin Sun wrote:
Hello all,
I wrote a function with many arguments. Then I need to call it many times
with changes on some arguments only. Is there any way to write a function or
have a method to "updat
Hi,
who of you in this forum uses R (http://www.r-project.org/) with the
multicore, SNOW or CUDA packages, so for advanced calculations that need
more power than a workstation CPU? On which hardware do you compute these
scripts? At home/ at work or do you have data center access somewhere?
The b
Chris,
Well, the 'answer' could be:
which(sapply(a, function(x) all(x == c(1,2
But I wonder how these elements of 'a' in your
actual application are coming to be? If you're
constructing them, you can give the elements of
the list names, and then it doesn't matter what
numerical index they
Is the algorithm converging? Is there separation (i.e.,
perfect predictor) in the model?
Are you getting a warning about fitted probabilities of
0 or 1?, etc.
We would need much more information (preferably a reproducible
example) before we can help.
Benjamin Godlove wrote:
Dear R developers,
Well, the error message seems relatively straightforward.
When you run str(x) (you did not provide the data)
you should see 1 or more components are factors that have more than 32
levels. Apparently you can't include those predictors in a call
to randomForest.
You might find the following line
On 11/09/2010 09:16 PM, vicho wrote:
I want to make a function for geometric seqeunce
since
testing=function(x){i=1;ans=1;while(true){ans=ans+(1/x)^i ; i=i+1}
;return(ans)}
doesn't work... the program is freeze...
What exactly are you trying to do? Where does "true" get set?
Did you mean T
This type of object has the "matrix" class in R.
So just use ?matrix to create it.
matrix(1:25, ncol = 5)
for example.
On 11/09/2010 08:55 PM, sachinthaka.abeyward...@allianz.com.au wrote:
Hi All,
I want to have an array/ matrix that looks this
x<- 0 0 1 1
1
?set.seed is what you're looking for
Xiaoxi Gao wrote:
Hello R users,
Here is my question about generating random sample. How to set the random seed to
recreate the same random numbers? For example, 10 random numbers is generated from
N(0,1), then "runif(10)" is used.What if I want to get the
Then one solution is to use
rbind.fill from the plyr package.
johannes rara wrote:
This is the ideal result (data.frame):
result
names X1 X2 X3
1 a 1 2 NA
2 b 1 2 3
2010/11/8 Erik Iverson :
So what do you want the matrix to
look like, since the number of columns
will be
So what do you want the matrix to
look like, since the number of columns
will be different between the two rows?
johannes rara wrote:
Thanks, data.frame or matrix.
-J
2010/11/8 Erik Iverson :
What class of object / structure do you exactly want
in the end? A matrix, a data.frame, a vector
What class of object / structure do you exactly want
in the end? A matrix, a data.frame, a vector?
johannes rara wrote:
Hi,
How to rbind these vectors from a list?:
l <- list(a = c(1, 2), b = c(1, 2, 3))
l
$a
[1] 1 2
$b
[1] 1 2 3
do.call(rbind, l)
[,1] [,2] [,3]
a121
b
On 11/06/2010 11:36 AM, Robert Ruser wrote:
Hello R Users,
I'm wondering if there exists any elegant and simple way to do the
following: I have a data.frame X fills in numbers. I have a vector y with
numbers as well. Every value in X that is equal to any values in y should
be replaced by e.g. 1.
Could you give a small reproducible example please?
It is not clear to me what your looping structure is
doing, or what your goal here is.
There may be a much simpler method than introducing
subscripts.
--Erik
Wade Wall wrote:
Hi all,
I have a dataframe (df1) that I am trying to select
27;ID' in the subset argument.
-Erik
mp.sylves...@gmail.com wrote:
Hi,
I have a question about %in% and subsettin data frames.
Say I need to keep ID 1,2,4,5, 10 from the data frame dat. I can do:
dat <- data.frame(ID = 1:10, var = 1:10)
someID <- c(1,2,4,5,10)
subset(dat, dat$ID %in% s
eries is
really useful for this.)
--Erik
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
DomDom wrote:
Hi there,
i´ve got a problem with how to create a vector with three variables out of
three seperate ascii files.
These three ascii files contain pixel information of the same image but
different bands and i need a matrix of
vectors, with each vector containing the corresponding
cture, I'd store them in a list and
do:
CombinedSamples <- do.call(rbind, sampleList)
otherwise perhaps using
?Reduce and ?merge. If you can provide a more complete example
to the list, please do. You need not resort to a for loop/get
hack for this.
Best,
--Erik
can find more details about this in the posting
guide, linked to at the bottom of every email.
Best,
--Erik
Matevž Pavlič wrote:
Hi all,
I understand that you most of you this is a peice of cake but i am a
complete newbie in thisso any example would be greatly
aprpeciated and also any hint
in my case, this happens when viewing a PDF
with that plotting character under old versions of Evince, but
not newer.
--Erik
Rafael Björk wrote:
Dear R-users
When trying to import graphics from an pdf-file to a Vector graphics editor
(I use Inkscape, but i've confirmed the same problem on
Just
merge(df1, df2, all = TRUE)
does it, yes?
Dimitri Liakhovitski wrote:
Hello!
I have 2 data frames like this (well, actually, I have 200 of them):
df1<-data.frame(location=c("loc 1","loc 2","loc
3"),date=c("1/1/2010","1/1/2010","1/1/2010"), a=1:3,b=11:13,c=111:113)
df2<-data.frame(locati
ffer slightly?
I've heard of the reshape2 package, but have no idea
if that's replaced the reshape package yet.
--Erik
Dimitri Liakhovitski wrote:
Hello!
I have a data frame like this one:
mydf<-data.frame(city=c("a","a","a","a","a&quo
Note that these methods don't 'delete' observations.
They all create brand new objects that are
subsets of the test.df object. You can effectively
'delete' the observations by replacing the original
data.frame with the returned object...
so
test.df <- head(test.
It depends on which 20 you want.
If you have a data.frame called 'test.df', you can do:
#first 20
test.df[20, ]
-or-
head(test.df, 20)
#random 20
test.df[sample(nrow(test.df), 20), ]
None of this was tested, but it should be a start.
--Erik
Matevž Pavlič wrote:
Hi,
I am
le, and therefore exists. You can
do checks on that object to see that it conforms
to any constraints you have set.
2) does not pass in the object, in which case
you can test for that with ?missing.
Is writing your own functions for others to
use what you're doing?
--Erik
___
ivo welch wrote:
quick programming questions. I want to "turn on" more errors. there
are two traps I occasionally fall into.
* I wonder why R thinks that a variable is always defined in a data frame.
> is.defined(d)
[1] FALSE
> d= data.frame( x=1:5, y=1:5 )
> is.defined(
lord12 wrote:
s= "Hey"
a = "Hello"
table = rbind(s,a)
write.table(table,paste("blah",".PROPERTIES",sep = ""),row.names =
FALSE,col.names = FALSE)
In my table, how do I output only the words and not the words with the
quotations?
You read the help page for the function you're using :).
Fro
?head or just
df[1:20, ]
Louis Plough wrote:
Hi,
I am simply looking for the function that will allow you to look at the top
20 lines of a long dataset?
LP
On Mon, Nov 1, 2010 at 10:46 AM, Louis Plough wrote:
Hi,
I am trying to generate all possible permutations (choose 2) of a vector,
b,
Simply read the ?library help page, where you'll find under Details:
To suppress messages during the loading of packages use
‘suppressPackageStartupMessages’: this will suppress all messages
from R itself but not necessarily all those from package authors.
Christofer Bogaso wrote
I suggest using the most recent version of R (2.12.0 I believe)
and providing a reproducible example, showing us exactly how you
are creating this data.frame (assuming it still exhibits the
behavior).
--Erik
ANJAN PURKAYASTHA wrote:
Hi,
I'm creating a data frame of 24 columns and 45101
eriod=NA)), n=N,
innov=YourSerie)
I'm not sure, but maybe this help you.
Salute.
Juan.
On 2010-10-28, at 8:08 PM, Knut Erik Vedahl wrote:
Hi,
I'm currently working with a SARIMA model from which I want to make
simulations. As I understand, neither sarima.Sim nor the functions
i
Hi,
I'm currently working with a SARIMA model from which I want to make
simulations. As I understand, neither sarima.Sim nor the functions in
the gsarima package use historic realizations of the time series to
simulate future values. However, I want to use historic values as
input and sim
1 - 100 of 826 matches
Mail list logo