Displaying 20 results from an estimated 9000 matches similar to: "What is the most efficient practice to develop an R package?"
2018 Jan 30
4
Best practices in developing package: From a single file
Mehmet,
That is a loaded topic, not unlikely other topics preoccupying us these days.
There is package.skeleton() in base R as you already mentioned. It drove me
bonkers that it creates packages which then fail R CMD check, so I wrote a
wrapper package (pkgKitten) with another helper function (kitten()) which
calls the base R helper and then cleans up it---but otherwise remains
faithful to it.
2011 Oct 18
1
cygwing warming when creating a package in windows
Dear All,
I am a beginner creating R packages. I followed the Leisch (2009) tutorial
and the document ?Writing R Extensions? to write an example.
I installed R 2.12.2 (I also tried R2.13.2), the last version of Rtools and
the recommended packages in a PC with Windows 7 Home Premium.
I can run R CMD INSTALL linmod in the command prompt and the R CMD check
linmod. The following outputs are
2008 Mar 30
1
package.skeleton.S4
Hi the devel list.
I am adapting the package.skeleton to S4 classes and methods
I would have been very proud to post a new working function on this list.
Unfortunately, I do not manage to solve all the problems. Mainly
- sys.source does not compile a file with setClass
- dumpMethod does not exists yet
In the following code, thise two problems are notified by a line
#################
Still
2008 Aug 07
1
package.skeleton does invalide regular name, bis... (PR#12020)
Hi the list,
I guess I find an other bug (the first one is at the end off this mail)
in package.skeleton. It occurs when we give as code_file some file that
are not in the current directories.
If we give a single file to code_file (like code_file=3D"riri/fifi.R"),
it does not reconize fifi.R as a regular name and change it to
riri/zfifi.R
If we give several file to code_file (like
2008 Jul 15
1
package.skeleton does invalide regular name...
Hi the list,
I am using package.skeleton on a file that has a very classic name, but
package.skeleton detect it as a invalid name :
--- 8< -------
package.skeleton(name="packClassicBis",code_files="./packClassic/R/progClassic.R")
Cr?ation des r?pertoires...
Cr?ation de DESCRIPTION...
Cr?ation de 'Read-and-delete-me'...
Recopiage des fichiers de code...
Cr?ation
2011 Jun 09
1
package.skeleton() does not create 'data' folder
Hi again, yesterday I mailed this query however I could not see this
on the mail list. Therefore, I am reposting it again.
I was using package.skeleton() function to create the
skeleton of my package in windows. Here is my attempt:
rm(list = ls())
setwd("F:/R_PackageBuild")
package.skeleton("trial1", namespace = TRUE, code_files =
"F:/R_PackageBuild/trial.r")
In
2011 Dec 16
2
package.skeleton()
Hi--
I'm creating an R package, I've read through "Writing R Extensions" and the
package.skeleton() R page-- and I'm still running into a little confusion.
I would greatly appreciate any advice you can provide.
Where do I run my following line of code from?:
> package.skeleton(name = "a", code_files = "EsetObject.r"
I'm currently running it from
2017 Sep 14
2
To implement OO or not in R package, and if so, how to structure it?
> Did you read this?
> https://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf
>
> Maybe it could give you some insight in how to create package.
That resource is ~9 years old. There are more modern treatments
available. You can read mine at http://r-pkgs.had.co.nz.
Hadley
--
http://hadley.nz
2009 Nov 25
1
problem in building an R package
i am trying to build an R package and submit to CRAN.
i am using -
package.skeleton(name="xxzz", code_files = "H:\xxzz.R")
to build package xxzz.
---------------------------
The code above generates 'xxzz' folder.
It seems that I have to manually edit the files generated in xxzz folder (to
add titles, authors, etc)
--------------------------
But when I re-run -
2013 Mar 12
1
Cook's distance
Dear useRs,
I have some trouble with the calculation of Cook's distance in R.
The formula for Cook's distance can be found for example here:
http://en.wikipedia.org/wiki/Cook%27s_distance
I tried to apply it in R:
> y <- (1:400)^2
> x <- 1:100
> lm(y~x) -> linmod # just for the sake of a simple example
>
2008 Apr 13
1
R 2.7 package.skeleton
Hi the devel list
I am testing package.skeleton in R 2.7 (download today). I get an error
that I do not understand. I guess it is not an error from my code since
I have no probleme when I source it. So is it a error in
package.skeleton?
Here is my code :
--- 8< ------ File essai.r -------------
setClass(
Class="ClusterizLongData",
representation=representation(
2017 Sep 14
1
To implement OO or not in R package, and if so, how to structure it?
>>> Did you read this?
>>> https://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf
>>>
>>> Maybe it could give you some insight in how to create package.
>>
>> That resource is ~9 years old. There are more modern treatments available. You
>> can read mine at http://r-pkgs.had.co.nz.
>>
>> Hadley
>>
Thanks both.
2011 Jun 09
1
Permission denied in Windows 7
I'm using package.skeleton() windows 7, 64 bit.
When I try to specify the code_files
package_skeleton(....code_files = " some directory")
I get a warning that that the connection cannot be opened and
I get a Permissions denied error.
I'm running R as admin and I've given everybody full permissions on the
folder.
What am I missing
[[alternative HTML version deleted]]
2010 Apr 27
3
Problem calculating multiple regressions on a data frame.
Hi there,
I am stuck trying to solve what should be a fairly easy problem.
I have a data frame that essentially consists of (ID, time as seqMonth,
variable, value) and i want to find the regression coefficient of value vs
time for each combination of ID and Variable.
I have tried several approaches and none of them seems to work as i
expected.
For example, i have tried:
2009 Jan 30
2
error message with roxygen
Hello useRs,
I'm trying to use the Roxygen package.
Here my code file :
#' A packge to check Roxygen's sanity
#' @name helloRoxygen-package
#' @docType package
NA
And my R code to generate the package :
library(roxygen)
package.skeleton("helloRoxygen", code_files = "roxy.r", force = T)
roxygenize("helloRoxygen", "helloRoxygen",
2006 Jan 11
1
updating formula inside function
Dear R-Helpers
Given a function like
foo <- function(data,var1,var2,var3) {
f <- formula(paste(var1,'~',paste(var2,var3,sep='+'),sep=''))
linmod <- lm(f)
return(linmod)
}
By typing
foo(mydata,'a','b','c')
I get the result of the linear model a~b+c.
How can I rewrite the function so that the formula can be updated inside
the function,
2010 Jun 18
1
How to calculate the robust standard error of the dependent variable
Hi, folks
linmod=y~x+z
summary(linmod)
The summary of linmod shows the standard error of the coefficients. How can
we get the sd of y and the robust standard errors in R?
Thanks!
[[alternative HTML version deleted]]
2010 Jun 21
2
How to predict the mean and variance of the dependent variable after regression
Hi, folks,
As seen in the following codes:
x1=rlnorm(10)
x2=rlnorm(10,mean=2)
y=rlnorm(10,mean=10)### Fake dataset
linmod=lm(log(y)~log(x1)+log(x2))
After the regression, I would like to know the mean of y. Since log(y) is
normal and y is lognormal, I need to know the mean and variance of log(y)
first. I tried mean (y) and mean(linmod), but either one is what I want.
Any tips?
Thanks in
2017 Sep 14
0
To implement OO or not in R package, and if so, how to structure it?
Hi Hadley
Yes, I found it too quite easily by Google.
Cheers
Petr
> -----Original Message-----
> From: Hadley Wickham [mailto:h.wickham at gmail.com]
> Sent: Thursday, September 14, 2017 3:33 PM
> To: PIKAL Petr <petr.pikal at precheza.cz>
> Cc: Alexander Shenkin <ashenkin at ufl.edu>; r-help <r-help at r-project.org>
> Subject: Re: [R] To implement OO or not
2009 Sep 14
3
Eliminate cases in a subset of a dataframe
Hi folks,
I created a subset of a dataframe (i.e., selected only men):
subdata <- subset(data,data$gender==1)
After a residual diagnostic of a regression analysis, I detected three
outliers:
linmod <- lm(y ~ x, data=subdata)
plot(linmod)
Say, the cases 11,22, and 33 were outliers.
Here comes the problem: When I want to exclude these three cases in a
further regression analysis,
- for