Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify 'length' attribute of variable in XPT file #20

Open
elimillera opened this issue Dec 11, 2020 · 3 comments
Open

Specify 'length' attribute of variable in XPT file #20

elimillera opened this issue Dec 11, 2020 · 3 comments

Comments

@elimillera
Copy link

Hello,

I am writing an XPT file and I would like to specify the length attribute of the character variables. Looking at the write.xport function it looks like this is set as max(c(1,nchar(var, "bytes", keepNA=FALSE))). Would you be open to a PR that adds the option to pass an attribute "SASlength" that overrides the length on character variables? I've tested this out and it can be handled similarly to "SASformat".

mtcars2$mpg <- as.character(mtcars2$mpg)
attr(mtcars2$mpg, "SASlength") <- 20
write.xport(mtcars2, file = "test.xpt")

image
Thanks,
Eli

@warnes
Copy link
Member

warnes commented Dec 12, 2020

Hi Eli, a PR is very welcome!

@elimillera
Copy link
Author

Hey @warnes,

Do you have a timeline when SASxport 1.8.0 will be going to CRAN?

Thanks!
Eli

@bms63
Copy link

bms63 commented Nov 2, 2021

@warnes Hi there, Just curious when the PR @elimillera made to SASxport will be going to CRAN? We have some functionality with a package called xportr that has a dependency on Eli's update. The xportr package might used in another package called admiral in the creation of ADaM datasets. Yay! Anyways, some of this is hard to do with company firewalls and such and not being able to use install_github() from @elimillera PR.

Let us know if you need any help or what we can do. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants