Windows metafile problem

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows metafile problem

Smith, Phil (CDC/CCID/NCIRD)
Hi All:

I'm using win.metafile() to produce windows metafiles.

When I use Word to insert the wmf picture, Word gives an error!

I did my homework in posting this question, and couldn't find a fix.

Any suggestions?

Phil Smith
CDC

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Windows metafile problem

Chuck Cleland
The following:

win.metafile("c:/test.emf")
plot(rnorm(10))
dev.off()

works for me to create the enhanced windows metafile, which I can then
insert into MS-Word.  How are you creating the metafile in R?  What is
the error that MS-Word gives?

Smith, Phil wrote:

> Hi All:
>
> I'm using win.metafile() to produce windows metafiles.
>
> When I use Word to insert the wmf picture, Word gives an error!
>
> I did my homework in posting this question, and couldn't find a fix.
>
> Any suggestions?
>
> Phil Smith
> CDC
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Windows metafile problem

Charles Annis, P.E.
In reply to this post by Smith, Phil (CDC/CCID/NCIRD)
When you open the metafile with something like

win.metafile(filename = file.name, width = 6.5, height = 6.5, pointsize =
12)

Where you have defined the file.name to include the path, you then, of
course, execute the R logic to create the file.

BUT, don't forget to close the file to tidy things up.  Otherwise the file
will be there, but it won't be useable.  So your final statement should be

dev.off()


Charles Annis, P.E.

[hidden email]
phone: 561-352-9699
eFax:  614-455-3265
http://www.StatisticalEngineering.com
 

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Smith, Phil
Sent: Friday, February 17, 2006 8:40 AM
To: [hidden email]
Subject: [R] Windows metafile problem

Hi All:

I'm using win.metafile() to produce windows metafiles.

When I use Word to insert the wmf picture, Word gives an error!

I did my homework in posting this question, and couldn't find a fix.

Any suggestions?

Phil Smith
CDC

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

svyby and svyratio in the Thomas Lumley's survey package

Smith, Phil (CDC/CCID/NCIRD)
In reply to this post by Smith, Phil (CDC/CCID/NCIRD)
Dear R-ers:

I'm using Thomas Lumley's "survey" package.

I'd like to compute survey ratio estimates (numerator=~utd , denominator=~one) for each of serval domains using by=~factor(domain).

I can't quite work out the syntax for the call to the "svyby" function. I try:

svyby( numerator=~ utd, denominator=~one ,  by=~ factor(domain) , design=nis , svyratio )

and I get an error that says that "domain" is not found. (nis is the design object)

Can someone steer me into the correct syntax?

 

Thanks,

Phil Smith

CDC


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: svyby and svyratio in the Thomas Lumley's survey package

Thomas Lumley
On Thu, 23 Feb 2006, Smith, Phil wrote:

> Dear R-ers:
>
> I'm using Thomas Lumley's "survey" package.
>
> I'd like to compute survey ratio estimates (numerator=~utd ,
> denominator=~one) for each of serval domains using by=~factor(domain).
>
> I can't quite work out the syntax for the call to the "svyby" function. I try:
>
> svyby( numerator=~ utd, denominator=~one , by=~ factor(domain) ,
> design=nis , svyratio )
>
> and I get an error that says that "domain" is not found. (nis is the
> design object)
>

Hmm. I don't get the same error message (perhaps a question of versions?),
but there is a problem. svyby is not really set up to work with svyratio.
I will try to fix this, but there are simple workarounds.

If you do
  data(api)
  dstrat<-svydesign(id=~1,strata=~stype, weights=~pw,
        data=apistrat, fpc=~fpc)

  result <- svyby(~api.stu,by=~factor(stype), denominator=~enroll,
        design=dstrat,svyratio)

(ie, don't name the numerator argument) then the computations are done as
you want.  The result does not print correctly, because svyby() returns
some extra attributes that print() doesn't know how to handle.

You can extract the results you need with coef() or just remove the
extraneous attributes
> result
Error in unlist(x, recursive, use.names) :
         argument not a list
> coef(result)
   statistic.ratio statistic.var
E       0.8518163  4.945408e-05
H       0.8105702  0.0004193180
M       0.8356958  0.0003307829
> result$statistic.call<-NULL
> result
   factor(stype) statistic.ratio statistic.var         SE
E             E       0.8518163  4.945408e-05 0.00703236
H             H       0.8105702  0.0004193180 0.02047726
M             M       0.8356958  0.0003307829 0.01818744



Finally, the name of the denominator variable looks suspicious. If `one'
is a variable whose values are all 1 and you just want domain means you
can do the equivalent of
   svyby(~api00,~stype,design=dstrat,svymean)
to get the mean of api00 within each value of stype.  You don't need
svyratio(). In fact, part of the test suite for the survey package is to
check that svyratio, svymean, and svyglm give the same answers for domain
means.

  -thomas

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html