[R] Basic misunderstanding, or problem with my installation?
Nordlund, Dan (DSHS/RDA)
NordlDJ at dshs.wa.gov
Wed Jan 1 04:55:56 CET 2014
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Sarah Goslee
> Sent: Tuesday, December 31, 2013 4:55 PM
> To: David Parkhurst
> Cc: r-help at r-project.org
> Subject: Re: [R] Basic misunderstanding, or problem with my
> Hi David,
> Your code is showing up here with an arrow symbols. If it's an actual
> and paste, that's your problem: assignment in R is the two-character <-
> not an arrow symbol.
> Otherwise your code looks fine.
> On Tuesday, December 31, 2013, David Parkhurst wrote:
> > I've just uninstalled and then reinstalled R on my windows 7 machine.
> > To test my understanding of data frames, I'm trying the following
> > (I plan to do other things with it, if it would only work.)
> > Here's the code, which seems pretty basic to me:
> > ls()
> > nums ← c(1,2,3,4,5)
> > ltrs ← c(“a”,”b”,”c”,”d”,”e”)
> > df1 ← data.frame(nums,ltrs)
> > Here's what happens when I try to run it:
> > > ls()
> > character(0)
> > > nums ← c(1,2,3,4,5)
> > Error: unexpected input in "nums \"
> > > ltrs ← c(“a”,”b”,”c”,”d”,”e”)
> > Error: unexpected input in "ltrs \"
> > > df1 ← data.frame(nums,ltrs)
> > Error: unexpected input in "df1 \"
> > >
> > Am I really misunderstanding the basics, or is there something
> > wrong with my installation?
> > David
> > ______________________________________________
> > R-help at 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.
And after you get your assignment operator straightened out, you may need to change the quote marks in your character vector. It looks like they may be "smart quotes" from a word processor, rather than the plain single or double quote marks that R will accept.
Daniel J. Nordlund, PhD
Research and Data Analysis Division
Services & Enterprise Support Administration
Washington State Department of Social and Health Services
More information about the R-help