This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C2CEEC.9577DF20
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Let's say the two vectors are saved as objects (a and b). If you want =
to compare a and b, just go
a =3D=3D b
And you will get a list of TRUE and FALSE to correspond to the instances =
where a[i] corresponds to b[i]. =20
If you want to count how many times TRUE occurs, just go
sum(a =3D=3D b)
R turns TRUE into 1 by default. =20
----- Original Message -----=20
From: Nathan A. Paxton=20
To: gov2001-l(a)fas.harvard.edu=20
Sent: Friday, February 07, 2003 8:39 PM
Subject: [gov2001-l] R help
Hey all,
I'm one of the people new to R, so I'm operating as if flying =
blind in an F-16 with no idea what most of the controls do but I know =
how flight works conceptually.
So, on problem 1b, I've got two vectors going, I've randomized =
one of them (I think), and I am trying to compare the two, to see if the =
nth unit in each vector (one randomized, one not -- again, I think, =
though if you asked me to justify my code, I'd be shaky) is the same as =
the corresponding in the other. What commands do I use to do something =
like this?
Thanks. Hope you're all having a good Friday night!
-Nathan
----------
Nathan A. Paxton, Ph.D. Student
Dept. of Government
Littauer Hall
Harvard University
Cambridge, Massachusetts 02138
napaxton(a)fas.harvard.edu
http://www.people.fas.harvard.edu/~napaxton/
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
The most courageous act is still to think for yourself. Aloud.
- Coco Chanel
When you have to stay eight years away from California, you live in a =
perpetual state of homesickness.
- Ronald Reagan
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
------=_NextPart_000_000A_01C2CEEC.9577DF20
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD><X-TAB>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Let's say the two vectors are saved as objects (a =
and=20
b). If you want to compare a and b, just go</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>a =3D=3D b</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>And you will get a list of TRUE and FALSE to =
correspond to the=20
instances where a[i] corresponds to b[i]. </FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>If you want to count how many times TRUE occurs, =
just=20
go</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>sum(a =3D=3D b)</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>R turns TRUE into 1 by default.
</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message -----
</DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A title=3Dnapaxton(a)fas.harvard.edu=20
href=3D"mailto:napaxton@fas.harvard.edu">Nathan A. Paxton</A>
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dgov2001-l(a)fas.harvard.edu=20
=
href=3D"mailto:gov2001-l@fas.harvard.edu">gov2001-l@fas.harvard.edu</A>
=
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday,
February 07, 2003 =
8:39=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [gov2001-l]
R =
help</DIV>
=
<DIV><BR></DIV> </X-TAB>He=
y=20
=
all,<BR><BR><X-TAB> </X-TA=
B>I'm=20
one of the people new to R, so I'm operating as if flying blind in an =
F-16=20
with no idea what most of the controls do but I know how flight works=20
=
conceptually.<BR><BR><X-TAB> &nb=
sp;</X-TAB>So,=20
on problem 1b, I've got two vectors going, I've randomized one of them =
(I=20
think), and I am trying to compare the two, to see if the nth unit in =
each=20
vector (one randomized, one not -- again, I think, though if you asked =
me to=20
justify my code, I'd be shaky) is the same as the corresponding in the =
other. What commands do I use to do something like=20
=
this?<BR><BR><X-TAB> </X-T=
AB>Thanks. =20
Hope you're all having a good Friday =
night!<BR><BR>-Nathan<BR><X-SIGSEP>
<P></X-SIGSEP>----------<BR>Nathan A. Paxton, Ph.D.
Student<BR>Dept. =
of=20
Government<BR>Littauer Hall<BR>Harvard University<BR>Cambridge, =
Massachusetts=20
02138<BR><A=20
=
href=3D"mailto:napaxton@fas.harvard.edu">napaxton@fas.harvard.edu</A><BR>=
<FONT=20
color=3D#0000ff><A =
href=3D"http://www.people.fas.harvard.edu/~napaxton/"=20
=
eudora=3D"autourl">http://www.people.fas.harvard.edu/~napaxton…
R></FONT>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
<BR>The=20
most courageous act is still to think for yourself. =20
=
Aloud.<BR><X-TAB> </X-TAB>=
-=20
Coco Chanel<BR><BR>When you have to stay eight years away from =
California, you=20
live in a perpetual state of=20
=
homesickness.<BR><X-TAB> <=
/X-TAB>-=20
Ronald=20
=
Reagan<BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=20
</P></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_000A_01C2CEEC.9577DF20--