Displaying 20 results from an estimated 4000 matches similar to: "Problem with foreign package"
2009 Jan 03
1
Bug report in foreign library (PR#13425)
here appears to be a bug in the foreign library. The following code used to
work, but now generates an error when 'package="SAS"' is specified:
ds <- read.csv("http://www.math.smith.edu/sasr/datasets/help.csv")
# running foreign package version 0.8-30
library(foreign)
# this works fine
write.foreign(ds, "foo", "bar", package="Stata")
#
2006 Jul 13
1
writeForeignSAS and potential extensions
Dear R-devel,
I've made some potential extensions to writeForeignSAS
in 'foreign' that I wanted to pass along if anyone is
interested. I've attached the diff -u output against
the version found in foreign_0.8-15 and an .R file
with my changes. (In this .R file, the function is named
writeForeignSAS7 to simplify testing/comparisons.)
I've tried to alter the current
2024 Jun 06
1
Bug report for package foreign anf functon write.foreign
Dear all,
First of all, I thank you for the creation of the package.
I write this message concerning the write.foreign() function from the foreign package and a bug that I discovered.
When we want to save our dataset as a .sas file, the limit of variable names character is 8 by default. In SAS this limit is 32 character and an argument in the function, validvarname, can theorically switch the
2009 Nov 01
3
Collapse factor levels
I'm sure this is simple enough, but an R site search on my subject
terms did suggest a solution. I have a numeric vector with many
values that I wish to create a factor from having only a few levels.
Here is a toy example.
> x <- 1:10
> x <-
2009 Dec 01
1
An R vs. SAS Discrepancy: How do I determine which is correct?
I was messing around with some data in R and SAS (the reason is
unimportant) fitting a multiple linear regression and got a
curious discrepancy. The data set is too big to post, but if
someone wants it, I can send it.
So, here are the (partial) results:
From R:
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 61.11434 1.48065 41.275 < 2e-16 ***
sexWomen
2018 May 04
0
Converting a list to a data frame
It looks like you made a copy/paste error below. Your ata.frame should
be data.frame.
Kevin
On 05/04/2018 08:18 AM, Bill Poling wrote:
> Good morning.
>
> Novice usR. Here.
>
> I am following this string, among many, learning as I go.
>
> Quick question please?
>
> I thought that perhaps ata.frame was part of the zoo pkg, b/c when I
> searched it came up in
2018 May 04
2
Converting a list to a data frame
Good morning.
Novice usR. Here.
I am following this string, among many, learning as I go.
Quick question please?
I thought that perhaps ata.frame was part of the zoo pkg, b/c when I searched it came up in help?
However, evidently not or I am not using it properly.
Please advise, thank you.
x <- list(A=data.frame(x=1:2, y=3:4),B=data.frame(x=5:6,y=7:8))
x2 <- do.call(rbind,
2019 Jun 04
1
foreign:::writeForeignSAS patch not released?
Hello,
In May 2018 there was some R-devel discussion about a bug in
foreign:::writeForeignSAS. See here:
https://stat.ethz.ch/pipermail/r-devel/2018-May/076220.html
and it resulted in a patch. See:
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17256
And I see the changes in Subversion here:
https://svn.r-project.org/R-packages/trunk/foreign/R/writeForeignSAS.R
But I don't
2018 May 02
0
Converting a list to a data frame
Hi Kevin,
There is probably a better way, but it can be done in two steps like this
temp <- list(A=data.frame(x=1:2, y=3:4),B=data.frame(x=5:6,y=7:8))
temp <- lapply(names(temp), function(n, temp) {
temp[[n]]$type <- n
return(temp[[n]])
}, temp = temp)
do.call(rbind, temp)
On Wed, May 2, 2018 at 1:11 PM, Kevin E. Thorpe <kevin.thorpe at utoronto.ca>
wrote:
> I suspect
2008 Sep 27
10
FW: logistic regression
Sorry.
Let me try again then.
I am trying to find "significant" predictors" from a list of about 44
independent variables. So I started with all 44 variables and ran
drop1(sep22lr, test="Chisq")... and then dropped the highest p value from
the run. Then I reran the drop1.
Model:
MIN_Mstocked ~ ORG_CODE + BECLBL08 + PEM_SScat + SOIL_MST_1 +
SOIL_NUTR + cE + cN +
2008 Jan 23
5
latex{Hmisc} cannot find xdvi on MAC OS X
Hello.
I am posting this on behalf of a student in my class. I have been
introducing them to R.
I suspect that the problem I need help with is not so much an R
issue, but a MAC config issue, but I don't have enough MAC
experience to know what to do.
Anyway, on to the problem. We are using Frank Harrell's Hmisc
and Design packages. This student also wishes to use the latex
formatting
2010 Sep 21
1
reshape is re-ordering my variables
Is it an undocumented (at least I missed it if it's documented) feature
of the reshape function to do numeric variables followed by character?
I ask because that seems to be the case below.
> str(rcw)
'data.frame': 23 obs. of 21 variables:
$ ICU : int 1 18 17 9 22 19 6 16 25 26 ...
$ Q6.RC.1 : chr "SM" "JF" "IW"
2018 May 02
3
Converting a list to a data frame
Or add the type column first and then rbind:
x <- list(A=data.frame(x=1:2, y=3:4),B=data.frame(x=5:6,y=7:8))
x2 <- do.call(rbind, lapply(names(x), function(z)
data.frame(type=z, dat[[z]])))
----------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77843-4352
-----Original Message-----
From: R-help
2018 May 02
0
Converting a list to a data frame
Typo: dat[[z]] should be x[[z]]:
x2 <- do.call(rbind, lapply(names(x), function(z)
data.frame(type=z, x[[z]])))
x2
type x y
1 A 1 3
2 A 2 4
3 B 5 7
4 B 6 8
David C
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of David L Carlson
Sent: Wednesday, May 2, 2018 3:51 PM
To: William Dunlap <wdunlap at tibco.com>; Kevin E.
2018 May 02
0
Converting a list to a data frame
> x1 <- do.call(rbind, c(x, list(make.row.names=FALSE)))
> x2 <- cbind(type=rep(names(x), vapply(x, nrow, 0)), x1)
> str(x2)
'data.frame': 4 obs. of 3 variables:
$ type: Factor w/ 2 levels "A","B": 1 1 2 2
$ x : int 1 2 5 6
$ y : int 3 4 7 8
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, May 2, 2018 at 10:11 AM, Kevin E. Thorpe
2018 May 03
1
Converting a list to a data frame
>>>>> David L Carlson <dcarlson at tamu.edu>
>>>>> on Wed, 2 May 2018 21:43:52 +0000 writes:
> Typo: dat[[z]] should be x[[z]]:
>
> x2 <- do.call(rbind, lapply(names(x), function(z)
> data.frame(type=z, x[[z]])))
> x2
> type x y
> 1 A 1 3
> 2 A 2 4
> 3 B 5 7
> 4 B 6 8
>
>
2018 May 02
8
Converting a list to a data frame
I suspect this is pretty easy, but I'm having trouble figuring it out.
Basically, I have a list of data frames such as the following example:
list(A=data.frame(x=1:2, y=3:4),B=data.frame(x=5:6,y=7:8))
I would like to turn this into data frame where the list elements are
essentially rbind'ed together and the element name becomes a new
variable. For example, I would like to turn the
2018 May 17
2
Patch for bug 17256 'possible bug in writeForeignSAS in the foreign library when string is NA'
Attached is a patch to fix https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17256
'possible bug in writeForeignSAS in the foreign library when string is NA'
The patch
1. fixing the case where there were NA within a character column, and the case where all values are strings of length 0
2. general replacement of calls to `sapply` with `vapply` (and replacing any(is.na()) with
2010 May 17
1
BRugs under Linux?
Hello.
In this post:
http://finzi.psych.upenn.edu/Rhelp10/2010-March/233815.html
Uwe Ligges suggests using BRugs rather than R2WinBUGS under windows. He
also notes that it is not in the main CRAN repository, but it is in
"extras" which is a default repository under windows.
I have OpenBUGS 3.1.0 (the latest that has a native Linux version which
is no longer called linBUGS)
2012 Jan 17
2
net classification improvement?
Greetings,
I have generated several ROC curves and would like to compare the AUCs.
The data are cross sectional and the outcomes are binary. I am testing
which of several models provide the best discrimination. Would it be most
appropriate to report AUC with 95% CI's?
I have been looking in to the "net reclassification improvement" (see
below for reference) but thus far I can only