-1

I am using plyr to rename the columns of a large data set to a shorter aliases. The from names are very long with occasional unusual symbols (i.e. Â) This code works in in R Studio when I manually (i.e. Ctrl+R) execute the code. No errors.

However, when it is run using source in another script and/or in the standard Rgui (even using Ctrl+R), it recognizes some of the names in the from statement, but not others, which are identified in the error:

The following from values were not present in x

32/64 bit doesn't seem to make a difference. Can't identify character or value that is producing the error. Any solutions?

Should this be posted as an issue on the plyr Github?

I have prepared a dummy replica of the data set here.

The program that works in R Studio, but not in standard Rgui is here.

The code for the "source" call that produces errors is

source("dftest.R")

All software and packages updated on 3/18/2016.

See similar but unrelated question here.

Community
  • 1
  • 1
Sam
  • 281
  • 4
  • 10
  • please provide a small subset of data in the text of your question and not as a link; not only does it take a little more effort (that discourage many would-be volunteers), but it is also subject to future [link-rot](https://en.wikipedia.org/wiki/Link_rot). Same thing for your code: provide a [small](https://stackoverflow.com/help/mcve) and [reproducible](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) code example. – r2evans Mar 18 '16 at 15:20
  • @r2evans I'll work on that. Also a brief update: Looks like the code works if you copy directly from Rstudio text editor and paste into new Rgui script. But the script won't run, as saved by R studio. – Sam Mar 18 '16 at 15:37

1 Answers1

0

Looks like copying the code from R Studio text editor and pasting into native client text editor, and then saving, solved both the source problem and the native client problem.

Sam
  • 281
  • 4
  • 10