Giter VIP home page Giter VIP logo

formula.tools's People

Contributors

ctbrown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

bmfazio alexiajm

formula.tools's Issues

Bug `rhs.vars` function when there is a minus sign

The rhs.vars function cannot identify correctly the variables whenever there is a minus sign on the right-hand side of the formula.

Example:

f1 <- x ~ a + b - c
rhs(f1) # Ok
> rhs(f1)
[1] a + b - c
rhs.vars(f1) # c is missing
> rhs.vars(f1)
[1] "a" "b"

I'm ran this code in a Windows machine, formula.tools version 1.7.1.

get.vars(NULL, NULL) throws an error but used to return NULL

Hi,

Love the package, thanks for sharing it.

I'm having problems with get.vars with signature NULL. This comes up in a situation like this

 lhs.vars( ~ x)

which then calls get.vars on lhs(~x). Since lhs(~x) returns NULL this leads to get.vars being called with signature NULL, NULL and this throws an error.

In prior versions this would work and return NULL, which makes sense to me.

I tried to look in the NEWS to see if this was an expected change but there is no entry for 1.5.

Thanks for your time!

Best,
Paul

as.character.formula breaks base R

Loading the package breaks R's behaviour of as.character.default, which is not too convenient.

as.character(.~.) # "~" "." "."
library(formula.tools)
as.character(.~.) # ". ~ ."

Do you see an easy way to avoid this?

formula.tools breaks lmerTest difflsmeans

I'm not sure why this happens, but this throws an error only if the formula.tools package is loaded. I'm guessing it must be a bug in formula.tools:

library(formula.tools)
library(lmerTest)
m1 <- lmer(Informed.liking ~ Gender*Information +(1|Consumer), data=ham)
difflsmeans(m1, test.effs="Gender:Information")

FR: Refactor package using S3 functions

It might be advantageous, long-term to refactor this package using the considerable less complex S3 Methods. Most of the functions do not need multiple dispatch. And this obviates some problems with CRAN/roxygen2 incompatibilities.

Fix erroneous Rd tags created by roxygen2

> check_doc()
Bad \usage lines found in documentation object 'formula.parts-methods':
  <unescaped bksl>method{lhs}{<-}(x)
  <unescaped bksl>S4method{op}{<-}(x)
  <unescaped bksl>S4method{rhs}{<-}(x)
Bad \usage lines found in documentation object '.is.one.sided':
  <unescaped bksl>S4method{is.one.sided}{<-}(x, ...)
  <unescaped bksl>S4method{is.two.sided}{<-}(x)
Bad \usage lines found in documentation object 'op.type':
  <unescaped bksl>S4method{op.type}{<-}(x)

bug when assigning to empty lhs()

Using 1.5.4 I notice this bug when trying to assign lhs() in a one-sided formula:

f <- ~ A   
lhs(f)     
## NULL
lhs(f) <- quote(B)
f
## ~B

The expected result would be B ~ A, but instead the right-hand side gets replaced. There are no such issues when there is already something in the left-hand side:

f2 <- ZZZ ~ A   
lhs(f2) <- quote(B)
f2
## B ~ A

Fork formula.tools => expression tools

The name formula.tools does not accurately reflect the extent of the package functionality since the tools work on expressions and list as well. Most of this package should become expression.tools with the few formula specific functions remaining in this package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.