[R] What is the problem now?

PIKAL Petr petr.pikal at precheza.cz
Mon Jan 5 10:25:31 CET 2015


Hi

I am not sure what do you want to achieve.

I would change your text function

{text(min(gecici$Tarih)+0.1,y,paste(z,"sigma"),cex=.85,pos=3)}

and instead of copy paste you can open and close appropriate device (pdf, jpg or emf - from devEMF package)

Cheers
Petr


> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Levent
> TERLEMEZ
> Sent: Monday, January 05, 2015 9:23 AM
> To: r-help ‎[r-help at r-project.org]‎
> Subject: [R] What is the problem now?
>
> Hi Dear Users,
>
> I abonden ggplot2 adventure for the moment because of urgent results (i
> will of course will do this with ggplot2 because I would like to use
> ggplot2 much more than standart plots). But this time I came across
> with a different problem.
> Problem is different graphical outputs from screen and copy-paste. -3s
> to 3s texts at the desired points on the screen but only 3s text at the
> desired points on the copy-past to a word or another document.
>
>
> dput for d.oran;
>
> structure(list(Tarih = structure(c(12784, 12785, 12786, 12787,
> 12788), class = "Date"), EUROUSD = c(1.37820047639547,
> 1.37321712373714,
> 1.36448946153273, 1.35276621058894, 1.33879335902757), USDJPY =
> c(1.03465373983692,
> 1.02726827581633, 1.02488359667201, 1.02672163689113, 1.03386973180077
> ), EUROJPY = c(1.42596027714759, 1.41066238702292, 1.39844286695672,
> 1.38891433806688, 1.38413793103448)), .Names = c("Tarih", "EUROUSD",
> "USDJPY", "EUROJPY"), row.names = c(NA, 5L), class = "data.frame")
>
>
> dput for d.oran.ist;
> structure(list(x_bar = c(1.34056134982583, 0.990969887720573,
> 1.32651605042546, NA, NA), std_sap = c(0.0873935814603307,
> 0.137574609058213,
> 0.189820046956369, NA, NA)), .Names = c("x_bar", "std_sap"), row.names
> = c("EUROUSD",
> "USDJPY", "EUROJPY", "NA", "NA.1"), class = "data.frame")
>
>
> Both of these data frames are in function frames. And this my user
> function that produces these plots (it produces 3 plots for 3 exchange
> rates) and both 3 plots do the same thing.
>
>
> function(veri)
>     {
>     require(reshape2)
>     d.oran<-
> data.frame(veri[,1],veri[,2]/veri[,4],veri[,4]/veri[,3],veri[,2]/veri[,
> 3])
>     colnames(d.oran)<-c("Tarih","EUROUSD","USDJPY","EUROJPY")
>     dput(d.oran[1:5,])
>     x_bar<-colMeans(d.oran[,2:4])
>     std_sap<-apply(d.oran[,2:4],2,sd)
>     d.oran.ist<-data.frame(x_bar,std_sap)
>     colnames(d.oran.ist)<-c("x_bar","std_sap")
>     dput(d.oran.ist[1:5,])
>     d.oran<-melt(d.oran,id="Tarih")
>     d.oran$variable<-factor(d.oran$variable)
>         #print(x_bar)
>         #print(std_sap)
>     print(d.oran.ist)
>     print(d.oran[1:5,])
>     renkler<-c("red","blue","green","orange")
>     for(i in 1:3)
>         {
>         dev.new() # Here, I tried windows() too but nothing changed
>         gecici<-subset(d.oran,variable==levels(d.oran$variable)[i])
>
> plot(gecici$Tarih,gecici$value,main=levels(d.oran$variable)[i],type="l"
> ,ylim=c(d.oran.ist[i,1]-3*d.oran.ist[i,2]-
> .05,d.oran.ist[i,1]+3*d.oran.ist[i,2]+.05))
>         #segments(min(gecici$Tarih),d.oran.ist[i,1]+seq(-
> 3,3,1)*d.oran.ist[i,2],max(gecici$Tarih),d.oran.ist[i,1]+seq(-
> 3,3,1)*d.oran.ist[i,2])
>         abline(h=d.oran.ist[i,1]+seq(-
> 3,3,1)*d.oran.ist[i,2],col=renkler[4-abs(seq(-3,3,1))],lty="dashed")
>         for(z in -3:3)
>             {
>             y<-d.oran.ist[i,1]+z*d.oran.ist[i,2]
>             if(z!=0)
>
> {text(min(gecici$Tarih),y,substitute(paste(z,sigma)),cex=.85,pos=3,offs
> et=-.0001)}
>             #else
> {text(min(gecici$Tarih),y,substitute(paste(mu)),cex=.85,pos=2,offset=1)
> }
>             }
>         #plot()
>         }
>     }
>
>
> I really appreciate your valuable time make for me, and nice advices.
> Thanks to everybody for sharing experiences and knowledge,
>
> Levent TERLEMEZ.
>
>
>
>       [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

________________________________
Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. Delete the contents of this e-mail with all attachments and its copies from your system.
If you are not the intended recipient of this e-mail, you are not authorized to use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately accept such offer; The sender of this e-mail (offer) excludes any acceptance of the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into any contracts on behalf of the company except for cases in which he/she is expressly authorized to do so in writing, and such authorization or power of attorney is submitted to the recipient or the person represented by the recipient, or the existence of such authorization is known to the recipient of the person represented by the recipient.


More information about the R-help mailing list