0

I have written an R package in which the names of the functions are in Turkish. I wanna take that package to CRAN with internalization. I changed all of the Turkish names (of functions, of data sets) to English so that everybody can easily use the package. After that, I followed regular "library(roxygen2); library(devtools); library(digest); roxygenize("causfinder"); build("causfinder"); install("causfinder"); library(causfinder)" way in process.

At the end, all of the functions appear with their English names this time in the Object Browser of Revolution R (version 7.1.0 Academic License). So, for the conversion of the names of the functions, all are OK.

Problem:

But, interestingly, not all of the names of data files in the package are not converted to English.

What I did to solve the problem till now:

I tried every sort of trick I know:

1. I deleted package from library location (I have only 1 such location: "C:\Revolution\R-Enterprise-7.1\R-3.0.2\library") completely and rebuild package and install again.

2. I deleted package from working directory "C:\Users\erdogan\Documents\Revolution", and triggered "library(roxygen2); library(devtools); library(digest); roxygenize("causfinder"); build("causfinder"); install("causfinder"); library(causfinder)" process

3. By giving possibility to Buffer effects, I deleted "C:\Users\erdogan\Documents\Revolution\32_7.1" so that "PackageXMLs\causfinder.xml" in that folder does not meddle in improperly. I had R created "32_7.1" folder by restarting Revo R.

4. I applied tricks suggested by "Dirk Eddelbuettel" here: Update the dataset in an installed package

"updating the source and re-installing with a new distinctive version number": Not worked. "by forcefully overwriting it, possibly. Not the proper way to do it.": How to apply that force?

My findings that may perhaps give an idea to professionals to solve the problem:

Only one of the data files correctly got renamed, and at the end of that data file in object browser "[Package causfinder version 1.0 Index]" appears. The names of all the other data files are still in Turkish and at the end of those data files, the phrase "[Package causfinder version 1.0 Index]" does not appear! I did not do anything peculiar to that data file whose internalization was done correctly.

Any help will be greatly appreciated.

Community
  • 1
  • 1
Erdogan CEVHER
  • 1,788
  • 1
  • 21
  • 40
  • You write :"not all of the names of data files in the package are not converted to English." Do you mean you still have some Turkish terms not yet translated? – agstudy Oct 05 '14 at 16:50
  • I translated all the names of functions and all dataset files: dataset files: in "data" folder of R's working directory, and dataset documentation files: in the .Rd files in "man" folder of R's working directory, function files: "R" folder of R's working directory. But, "build, install" still result in Turkish names for some of the names of dataset files. Those must appear in English in Object Browser as well. – Erdogan CEVHER Oct 05 '14 at 16:57

1 Answers1

0

Step by Step Solution: (Notebook with 32-bit Windows; GUI: Revolution R Enterprise (32-bit))

1. Prepare the environment by cleaning related folders:
1a. Delete the package folder in R's library location via Windows Explorer:
(I have only 1 such location: I deleted "C:\Revolution\R-Enterprise-7.1\R-3.0.2\library\causfinder" folder)
(Run ".libPaths()" to see R's library locations and delete the package's folder from all R's library locations)

1b. Delete the package folder in R's working directory via Windows Explorer:
(I have only 1 such location: I deleted "C:\Users\erdogan\Documents\Revolution\causfinder" folder)
(Run "getwd()" to see R's working directory and delete the package's folder from all R's working directories)

1c. Delete the "32_7.1" or "64_7.1" folder (32bit, 64 bit R, whichever you use) from R's working directory via Windows Explorer:
The .xml file of the package in discussion in this folder may sometimes meddle in and affect the results of R commands, and gives unexpected results.
Delete "C:\Users\erdogan\Documents\Revolution\32_7.1" folder where "PackageXMLs\causfinder.xml" is located.
(When Revolution R restarted, 32_7.1 (or 64_7.1) folder is created automatically if it doesn't exist)

Restart Revolution R now.

2. Create .rda and .Rd files via R and put them in relevant location.
((For English ones, I created .rda and .Rd files like this:

V6Stationary43Obs.df <-     
read.csv("C:/Users/erdogan/Documents/Revolution/V6Stationary43ObsWithoutX.csv", header = TRUE, stringsAsFactors = FALSE)
# create V6Stationary43Obs.df.rda dataset file; df to denote data frame
save(V6Stationary43Obs.df, file="V6Stationary43Obs.df.rda")          
prompt(V6Stationary43Obs.df) # creates V6Stationary43Obs.df.Rd help file))

((For Turkish ones, I performed the followings once upon a time

D6Duragan43Gozlem.dvc<- read.csv("C:/Users/erdogan/Documents/Revolution/D6Duragan43GozlemXsiz.csv", header = TRUE, stringsAsFactors = FALSE)
#  create D6Duragan43Gozlem.vc.rda dataset file; df to denote data frame
save(D6Duragan43Gozlem.vc, file="D6Duragan43Gozlem.vc.rda")
prompt(D6Duragan43Gozlem.vc) # create D6Duragan43Gozlem.vc.Rd help file))

3. Take the .rda and .Rd files (created in Step2) to the "data" and "man" folder in R's working directory via Windows Explorer:
V6Stationary43Obs.df.rda dataset file --> C:\Users\erdogan\Documents\Revolution\causfinder\data V6Stationary43Obs.df.Rd help file --> C:\Users\erdogan\Documents\Revolution\causfinder\man

4. Fill at least the "Title" and "Description" tags of .Rd files (created in Step3) via R: "File - Open - File... - V6Stationary43Obs.df.Rd"

\title{
V6Stationary43Obs is..... .
}
\description{
V6Stationary43Obs does..... .
}

5. Apply roxygenization:

library(roxygen2)
library(devtools)
library(digest)
roxygenize("causfinder")
build("causfinder")
install("causfinder")
library(causfinder)

Solution: (Notebook with 64-bit Windows; GUI: Revolution R Enterprise (32-bit))

The above process is performed with the following additional actions:

1. The datasets are created as usual (for example; ".df" to denote data frame):

X.df <- read.csv("C:/Users/erdogan/Documents/Revolution/X.csv", header = TRUE, stringsAsFactors = FALSE)
save(X.df, file="X.df.rda")  # X.df.rda dataset is created
prompt(X.df) #X.df.Rd help file is created.

2. Revolution R is closed, and in the working directory, the folder "32_7.3" is deleted. We delete this folder because: The information (functions, data sets, etc.) of our package (here: causfinder) are stored as .xml file in 32_7.3. However, this .xml file cannot update itself once we add our data sets one by one.

3. Revolution R is opened (the folder "32_7.3" is re-created). At this point, Step 5 above (Applying roxygenization) is performed. Once we do this, the datasets are visible in Revolution R's Object Browser.

4. The control of everything realized seamlessly: Go to the "data" folder of package's library location. Here, you must see only ".rdb, .rds, .rdx" files.

Solution: (Notebook with 64-bit Windows; GUI: Revolution R Enterprise (64-bit))

Apply the steps for 32-bits. If everything is OK, then fine: you are done. If not OK (i.e. datasets are not visible in Object Browser of Revo R and data folder of the package in the library location does not include only the .rdb, .rds, .rdx files), then do not panic:

You can still work with the datasets you created that are seen as .rda files in the package's library location: Use "data" command:

data(YourDatasetName, package = causfinder, lib.loc = YourLibraryLocation)

Learn about data command more. Upon using this command, you get the dataset in the Object Browser as an object of Global Environment.

Erdogan CEVHER
  • 1,788
  • 1
  • 21
  • 40