Line with linearly changing thickness

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

Line with linearly changing thickness

Mag. Ferri Leberl

Dear All,
I want to depict flows: At point x there is an input of a units. at point y, b units arrive.
Obviously, the line thicknes can be manipulated with (a constant) cex. But I want the thickness to change linearly from ~a in x to ~b in y.
Is there an out of the box solution for this?
Thank you in advance!
Yours, Ferri

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Line with linearly changing thickness

Peter Dalgaard-2
Hmm... I don't recall whether this has been packaged up, but Paul Murrell talked about it at useR in Brisbane.

https://www.youtube.com/watch?v=L6FawdEA3W0

-pd

> On 11 Nov 2018, at 11:44 , Ferri Leberl <[hidden email]> wrote:
>
>
> Dear All,
> I want to depict flows: At point x there is an input of a units. at point y, b units arrive.
> Obviously, the line thicknes can be manipulated with (a constant) cex. But I want the thickness to change linearly from ~a in x to ~b in y.
> Is there an out of the box solution for this?
> Thank you in advance!
> Yours, Ferri
>
> ______________________________________________
> [hidden email] 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.

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: [hidden email]  Priv: [hidden email]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Line with linearly changing thickness – installation issues

Mag. Ferri Leberl
Dear All,
Thanks to Peter for his hint to the lwline package.
As a pitty, I have difficulties to get it installed, as it requires https://github.com/Gibbsdavidl/twine which failes for me.

install_github("[hidden email]:Gibbsdavidl/twine.git")
 
ends with

** building package indices
Error in read.table(zfile, header = TRUE, as.is = FALSE) :
  more columns than column names
ERROR: installing package indices failed
* removing ‘/usr/local/lib/R/site-library/twine’
Fehler in i.p(...) :
  (konvertiert von Warnung) installation of package ‘/tmp/RtmpD3exKe/file730c303b4c3/twine_0.1.tar.gz’ had non-zero exit status

I found hints like
https://community.rstudio.com/t/lazydata-failed-for-for-package/4196 and
https://stat.ethz.ch/pipermail/r-help/2011-March/272829.html
that boil down to problems within the data subdir of the project – but I cannot (and should not) edit the project, can I?

Can anybody help me solving the problem?
Thank you in advance!
Yours, Ferri

 

Gesendet: Sonntag, 11. November 2018 um 15:38 Uhr
Von: "Peter Dalgaard" <[hidden email]>
An: "Ferri Leberl" <[hidden email]>
Cc: [hidden email]
Betreff: Re: [R] Line with linearly changing thickness
Hmm... I don't recall whether this has been packaged up, but Paul Murrell talked about it at useR in Brisbane.

https://www.youtube.com/watch?v=L6FawdEA3W0

-pd

> On 11 Nov 2018, at 11:44 , Ferri Leberl <[hidden email]> wrote:
>
>
> Dear All,
> I want to depict flows: At point x there is an input of a units. at point y, b units arrive.
> Obviously, the line thicknes can be manipulated with (a constant) cex. But I want the thickness to change linearly from ~a in x to ~b in y.
> Is there an out of the box solution for this?
> Thank you in advance!
> Yours, Ferri
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]
> and provide commented, minimal, self-contained, reproducible code.

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: [hidden email] Priv: [hidden email]








 

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Line with linearly changing thickness – installation issues

David Winsemius
I would have imagined that drawing a polygon would be the way most
people would have attempted.

Regarding Murrell's package:

I thought the package name was "vwline". My attempt to install was
unsuccessful>

 > devtools::install_github("pmur002/vwline")
Error in utils::download.file(url, path, method = download_method(),
quiet = quiet,  :
   cannot open URL
'https://api.github.com/repos/pmur002/vwline/contents/DESCRIPTION?ref=master'
 > install.packages("~/vwline-0.2-1.tar.gz", repo=NULL)
Installing package into ‘/home/david/R/x86_64-pc-linux-gnu-library/3.5.1’
(as ‘lib’ is unspecified)
Warning in untar2(tarfile, files, list, exdir, restore_times) :
   skipping pax global extended headers
ERROR: cannot extract package from ‘/home/david/vwline-0.2-1.tar.gz’
Warning in install.packages :
   installation of package ‘/home/david/vwline-0.2-1.tar.gz’ had
non-zero exit status


Furthermore, I do get the same error from attempting to install
pkg:twine from github.

-- David

Doing this from an Rstudio console running R 3.5.1 in Ubuntu 18.04

On 11/11/18 8:30 AM, Ferri Leberl wrote:

> Dear All,
> Thanks to Peter for his hint to the lwline package.
> As a pitty, I have difficulties to get it installed, as it requires https://github.com/Gibbsdavidl/twine which failes for me.
>
> install_github("[hidden email]:Gibbsdavidl/twine.git")
>  
> ends with
>
> ** building package indices
> Error in read.table(zfile, header = TRUE, as.is = FALSE) :
>    more columns than column names
> ERROR: installing package indices failed
> * removing ‘/usr/local/lib/R/site-library/twine’
> Fehler in i.p(...) :
>    (konvertiert von Warnung) installation of package ‘/tmp/RtmpD3exKe/file730c303b4c3/twine_0.1.tar.gz’ had non-zero exit status
>
> I found hints like
> https://community.rstudio.com/t/lazydata-failed-for-for-package/4196 and
> https://stat.ethz.ch/pipermail/r-help/2011-March/272829.html
> that boil down to problems within the data subdir of the project – but I cannot (and should not) edit the project, can I?
>
> Can anybody help me solving the problem?
> Thank you in advance!
> Yours, Ferri
>
>  
>
> Gesendet: Sonntag, 11. November 2018 um 15:38 Uhr
> Von: "Peter Dalgaard" <[hidden email]>
> An: "Ferri Leberl" <[hidden email]>
> Cc: [hidden email]
> Betreff: Re: [R] Line with linearly changing thickness
> Hmm... I don't recall whether this has been packaged up, but Paul Murrell talked about it at useR in Brisbane.
>
> https://www.youtube.com/watch?v=L6FawdEA3W0
>
> -pd
>
>> On 11 Nov 2018, at 11:44 , Ferri Leberl <[hidden email]> wrote:
>>
>>
>> Dear All,
>> I want to depict flows: At point x there is an input of a units. at point y, b units arrive.
>> Obviously, the line thicknes can be manipulated with (a constant) cex. But I want the thickness to change linearly from ~a in x to ~b in y.
>> Is there an out of the box solution for this?
>> Thank you in advance!
>> Yours, Ferri
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]
>> and provide commented, minimal, self-contained, reproducible code.
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Office: A 4.23
> Email: [hidden email] Priv: [hidden email]
>
>
>
>
>
>
>
>
>  
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Line with linearly changing thickness – installation issues

Fox, John
In reply to this post by Mag. Ferri Leberl
Dear David and Ferri,

Here's a simple implementation using polygon() (as David suggested). It's much less sophisticated than Paul Murrell's -- in particular, the ends of the line are simply vertical (but, with a bit more work, that too could be addressed) -- and uses standard R graphics rather than grid.

tline <- function(x, y, thickness, col="black", unit=0.005){
    # line of varying thickness
    #   x: vector of x coordinates
    #   y: vector of y coordinates
    #   thickness: units of thickness at each set of coordinates
    #   col: line colour
    #   unit: unit of thickness as fraction of vertical axis
    tl <- function(x1, x2, y1, y2, start, end){
        polygon(x=c(x1, x1, x2, x2, x1),
                y=c(y1 - start*units, y1 + start*units,
                    y2 + end*units, y2 - end*units,
                    y1 - start*units),
                col=col, border=col)
    }
    if (length(x) != length(y)) "x and y are of different lengths"
    if (length(x) != length(thickness))
        "length of thickness is different from x and y"
    if (length(x) < 2) "x and y are too short"
    usr <- par("usr")
    units <- (usr[4] - usr[3])*unit/2
    for (i in 2:length(x)){
        tl(x[i - 1], x[i], y[i - 1], y[i], thickness[i - 1], thickness[i])
    }
}

# example:

plot(c(-1, 1), c(0, 100), type="n")
tline(seq(-1, 1, by=0.1), y=(seq(1, 9.5, length=21))^2,
      thickness=seq(1, 20, length=21), col="blue")

I hope this helps,
 John

--------------------------------------
John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: socialsciences.mcmaster.ca/jfox/



> -----Original Message-----
> From: R-help [mailto:[hidden email]] On Behalf Of David
> Winsemius
> Sent: Sunday, November 11, 2018 12:23 PM
> To: [hidden email]
> Subject: Re: [R] Line with linearly changing thickness – installation
> issues
>
> I would have imagined that drawing a polygon would be the way most
> people would have attempted.
>
> Regarding Murrell's package:
>
> I thought the package name was "vwline". My attempt to install was
> unsuccessful>
>
>  > devtools::install_github("pmur002/vwline")
> Error in utils::download.file(url, path, method = download_method(),
> quiet = quiet,  :
>    cannot open URL
> 'https://api.github.com/repos/pmur002/vwline/contents/DESCRIPTION?ref=ma
> ster'
>  > install.packages("~/vwline-0.2-1.tar.gz", repo=NULL) Installing
> package into ‘/home/david/R/x86_64-pc-linux-gnu-library/3.5.1’
> (as ‘lib’ is unspecified)
> Warning in untar2(tarfile, files, list, exdir, restore_times) :
>    skipping pax global extended headers
> ERROR: cannot extract package from ‘/home/david/vwline-0.2-1.tar.gz’
> Warning in install.packages :
>    installation of package ‘/home/david/vwline-0.2-1.tar.gz’ had non-
> zero exit status
>
>
> Furthermore, I do get the same error from attempting to install
> pkg:twine from github.
>
> -- David
>
> Doing this from an Rstudio console running R 3.5.1 in Ubuntu 18.04
>
> On 11/11/18 8:30 AM, Ferri Leberl wrote:
> > Dear All,
> > Thanks to Peter for his hint to the lwline package.
> > As a pitty, I have difficulties to get it installed, as it requires
> https://github.com/Gibbsdavidl/twine which failes for me.
> >
> > install_github("[hidden email]:Gibbsdavidl/twine.git")
> >
> > ends with
> >
> > ** building package indices
> > Error in read.table(zfile, header = TRUE, as.is = FALSE) :
> >    more columns than column names
> > ERROR: installing package indices failed
> > * removing ‘/usr/local/lib/R/site-library/twine’
> > Fehler in i.p(...) :
> >    (konvertiert von Warnung) installation of package
> > ‘/tmp/RtmpD3exKe/file730c303b4c3/twine_0.1.tar.gz’ had non-zero exit
> > status
> >
> > I found hints like
> > https://community.rstudio.com/t/lazydata-failed-for-for-package/4196
> > and https://stat.ethz.ch/pipermail/r-help/2011-March/272829.html
> > that boil down to problems within the data subdir of the project – but
> I cannot (and should not) edit the project, can I?
> >
> > Can anybody help me solving the problem?
> > Thank you in advance!
> > Yours, Ferri
> >
> >
> >
> > Gesendet: Sonntag, 11. November 2018 um 15:38 Uhr
> > Von: "Peter Dalgaard" <[hidden email]>
> > An: "Ferri Leberl" <[hidden email]>
> > Cc: [hidden email]
> > Betreff: Re: [R] Line with linearly changing thickness Hmm... I don't
> > recall whether this has been packaged up, but Paul Murrell talked
> about it at useR in Brisbane.
> >
> > https://www.youtube.com/watch?v=L6FawdEA3W0
> >
> > -pd
> >
> >> On 11 Nov 2018, at 11:44 , Ferri Leberl <[hidden email]> wrote:
> >>
> >>
> >> Dear All,
> >> I want to depict flows: At point x there is an input of a units. at
> point y, b units arrive.
> >> Obviously, the line thicknes can be manipulated with (a constant)
> cex. But I want the thickness to change linearly from ~a in x to ~b in
> y.
> >> Is there an out of the box solution for this?
> >> Thank you in advance!
> >> Yours, Ferri
> >>
> >> ______________________________________________
> >> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mai
> >> lman/listinfo/r-help] PLEASE do read the posting guide
> >> http://www.R-project.org/posting-guide.html[http://www.R-project.org/
> >> posting-guide.html] and provide commented, minimal, self-contained,
> >> reproducible code.
> > --
> > Peter Dalgaard, Professor,
> > Center for Statistics, Copenhagen Business School Solbjerg Plads 3,
> > 2000 Frederiksberg, Denmark
> > Phone: (+45)38153501
> > Office: A 4.23
> > Email: [hidden email] Priv: [hidden email]
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > ______________________________________________
> > [hidden email] 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.
>
> ______________________________________________
> [hidden email] 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.
______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Line with linearly changing thickness – installation issues

Fox, John
In reply to this post by Mag. Ferri Leberl
And here's a simpler, loopless version:

tlines <- function(x, y, thickness, col="black", unit=0.005){
    # line of varying thickness
    #   x: vector of x coordinates
    #   y: vector of y coordinates
    #   thickness: units of thickness at each set of coordinates
    #   col: line colour
    #   unit: unit of thickness as fraction of vertical axis
    if (length(x) != length(y)) "x and y are of different lengths"
    if (length(x) != length(thickness))
        "length of thickness is different from x and y"
    if (length(x) < 2) "x and y are too short"
    usr <- par("usr")
    units <- (usr[4] - usr[3])*unit/2
    x <- c(x, rev(x))
    y <- c(y + thickness*units, rev(y) - rev(thickness)*units)
    polygon(x=x, y=y, col=col, border=col)
}

Best,
 John

> -----Original Message-----
> From: R-help [mailto:[hidden email]] On Behalf Of Fox, John
> Sent: Sunday, November 11, 2018 1:30 PM
> To: David Winsemius <[hidden email]>; Ferri Leberl
> <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [R] Line with linearly changing thickness – installation issues
>
> Dear David and Ferri,
>
> Here's a simple implementation using polygon() (as David suggested). It's
> much less sophisticated than Paul Murrell's -- in particular, the ends of the line
> are simply vertical (but, with a bit more work, that too could be addressed) --
> and uses standard R graphics rather than grid.
>
> tline <- function(x, y, thickness, col="black", unit=0.005){
>     # line of varying thickness
>     #   x: vector of x coordinates
>     #   y: vector of y coordinates
>     #   thickness: units of thickness at each set of coordinates
>     #   col: line colour
>     #   unit: unit of thickness as fraction of vertical axis
>     tl <- function(x1, x2, y1, y2, start, end){
>         polygon(x=c(x1, x1, x2, x2, x1),
>                 y=c(y1 - start*units, y1 + start*units,
>                     y2 + end*units, y2 - end*units,
>                     y1 - start*units),
>                 col=col, border=col)
>     }
>     if (length(x) != length(y)) "x and y are of different lengths"
>     if (length(x) != length(thickness))
>         "length of thickness is different from x and y"
>     if (length(x) < 2) "x and y are too short"
>     usr <- par("usr")
>     units <- (usr[4] - usr[3])*unit/2
>     for (i in 2:length(x)){
>         tl(x[i - 1], x[i], y[i - 1], y[i], thickness[i - 1], thickness[i])
>     }
> }
>
> # example:
>
> plot(c(-1, 1), c(0, 100), type="n")
> tline(seq(-1, 1, by=0.1), y=(seq(1, 9.5, length=21))^2,
>       thickness=seq(1, 20, length=21), col="blue")
>
> I hope this helps,
>  John
>
> --------------------------------------
> John Fox, Professor Emeritus
> McMaster University
> Hamilton, Ontario, Canada
> Web: socialsciences.mcmaster.ca/jfox/
>
>
>
> > -----Original Message-----
> > From: R-help [mailto:[hidden email]] On Behalf Of David
> > Winsemius
> > Sent: Sunday, November 11, 2018 12:23 PM
> > To: [hidden email]
> > Subject: Re: [R] Line with linearly changing thickness – installation
> > issues
> >
> > I would have imagined that drawing a polygon would be the way most
> > people would have attempted.
> >
> > Regarding Murrell's package:
> >
> > I thought the package name was "vwline". My attempt to install was
> > unsuccessful>
> >
> >  > devtools::install_github("pmur002/vwline")
> > Error in utils::download.file(url, path, method = download_method(),
> > quiet = quiet,  :
> >    cannot open URL
> > 'https://api.github.com/repos/pmur002/vwline/contents/DESCRIPTION?ref=
> > ma
> > ster'
> >  > install.packages("~/vwline-0.2-1.tar.gz", repo=NULL) Installing
> > package into ‘/home/david/R/x86_64-pc-linux-gnu-library/3.5.1’
> > (as ‘lib’ is unspecified)
> > Warning in untar2(tarfile, files, list, exdir, restore_times) :
> >    skipping pax global extended headers
> > ERROR: cannot extract package from ‘/home/david/vwline-0.2-1.tar.gz’
> > Warning in install.packages :
> >    installation of package ‘/home/david/vwline-0.2-1.tar.gz’ had non-
> > zero exit status
> >
> >
> > Furthermore, I do get the same error from attempting to install
> > pkg:twine from github.
> >
> > -- David
> >
> > Doing this from an Rstudio console running R 3.5.1 in Ubuntu 18.04
> >
> > On 11/11/18 8:30 AM, Ferri Leberl wrote:
> > > Dear All,
> > > Thanks to Peter for his hint to the lwline package.
> > > As a pitty, I have difficulties to get it installed, as it requires
> > https://github.com/Gibbsdavidl/twine which failes for me.
> > >
> > > install_github("[hidden email]:Gibbsdavidl/twine.git")
> > >
> > > ends with
> > >
> > > ** building package indices
> > > Error in read.table(zfile, header = TRUE, as.is = FALSE) :
> > >    more columns than column names
> > > ERROR: installing package indices failed
> > > * removing ‘/usr/local/lib/R/site-library/twine’
> > > Fehler in i.p(...) :
> > >    (konvertiert von Warnung) installation of package
> > > ‘/tmp/RtmpD3exKe/file730c303b4c3/twine_0.1.tar.gz’ had non-zero exit
> > > status
> > >
> > > I found hints like
> > > https://community.rstudio.com/t/lazydata-failed-for-for-package/4196
> > > and https://stat.ethz.ch/pipermail/r-help/2011-March/272829.html
> > > that boil down to problems within the data subdir of the project –
> > > but
> > I cannot (and should not) edit the project, can I?
> > >
> > > Can anybody help me solving the problem?
> > > Thank you in advance!
> > > Yours, Ferri
> > >
> > >
> > >
> > > Gesendet: Sonntag, 11. November 2018 um 15:38 Uhr
> > > Von: "Peter Dalgaard" <[hidden email]>
> > > An: "Ferri Leberl" <[hidden email]>
> > > Cc: [hidden email]
> > > Betreff: Re: [R] Line with linearly changing thickness Hmm... I
> > > don't recall whether this has been packaged up, but Paul Murrell
> > > talked
> > about it at useR in Brisbane.
> > >
> > > https://www.youtube.com/watch?v=L6FawdEA3W0
> > >
> > > -pd
> > >
> > >> On 11 Nov 2018, at 11:44 , Ferri Leberl <[hidden email]> wrote:
> > >>
> > >>
> > >> Dear All,
> > >> I want to depict flows: At point x there is an input of a units. at
> > point y, b units arrive.
> > >> Obviously, the line thicknes can be manipulated with (a constant)
> > cex. But I want the thickness to change linearly from ~a in x to ~b in
> > y.
> > >> Is there an out of the box solution for this?
> > >> Thank you in advance!
> > >> Yours, Ferri
> > >>
> > >> ______________________________________________
> > >> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > >> https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/m
> > >> ai lman/listinfo/r-help] PLEASE do read the posting guide
> > >> http://www.R-project.org/posting-guide.html[http://www.R-project.or
> > >> g/ posting-guide.html] and provide commented, minimal,
> > >> self-contained, reproducible code.
> > > --
> > > Peter Dalgaard, Professor,
> > > Center for Statistics, Copenhagen Business School Solbjerg Plads 3,
> > > 2000 Frederiksberg, Denmark
> > > Phone: (+45)38153501
> > > Office: A 4.23
> > > Email: [hidden email] Priv: [hidden email]
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > ______________________________________________
> > > [hidden email] 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.
> >
> > ______________________________________________
> > [hidden email] 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.
> ______________________________________________
> [hidden email] 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.
______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: [FORGED] Re: Line with linearly changing thickness – installation issues

Paul Murrell-2
In reply to this post by David Winsemius
Hi

This should hopefully work ...

library(devtools); install_github("pmur002/vwline/pkg@v0.1")

You can also do ...

library(devtools); install_github("pmur002/gridBezier@v1.0-0")
library(devtools); install_github("pmur002/vwline/pkg@v0.2-1")

... to get the latest version.

There is more info at ...

https://www.stat.auckland.ac.nz/~paul/Reports/VWline/vwline-intro/power-curve.html

... and even more in several other reports at ...

https://www.stat.auckland.ac.nz/~paul/index.html

Paul

On 12/11/18 6:22 AM, David Winsemius wrote:

> I would have imagined that drawing a polygon would be the way most
> people would have attempted.
>
> Regarding Murrell's package:
>
> I thought the package name was "vwline". My attempt to install was
> unsuccessful>
>
>  > devtools::install_github("pmur002/vwline")
> Error in utils::download.file(url, path, method = download_method(),
> quiet = quiet,  :
>    cannot open URL
> 'https://api.github.com/repos/pmur002/vwline/contents/DESCRIPTION?ref=master' 
>
>  > install.packages("~/vwline-0.2-1.tar.gz", repo=NULL)
> Installing package into ‘/home/david/R/x86_64-pc-linux-gnu-library/3.5.1’
> (as ‘lib’ is unspecified)
> Warning in untar2(tarfile, files, list, exdir, restore_times) :
>    skipping pax global extended headers
> ERROR: cannot extract package from ‘/home/david/vwline-0.2-1.tar.gz’
> Warning in install.packages :
>    installation of package ‘/home/david/vwline-0.2-1.tar.gz’ had
> non-zero exit status
>
>
> Furthermore, I do get the same error from attempting to install
> pkg:twine from github.
>
> -- David
>
> Doing this from an Rstudio console running R 3.5.1 in Ubuntu 18.04
>
> On 11/11/18 8:30 AM, Ferri Leberl wrote:
>> Dear All,
>> Thanks to Peter for his hint to the lwline package.
>> As a pitty, I have difficulties to get it installed, as it requires
>> https://github.com/Gibbsdavidl/twine which failes for me.
>>
>> install_github("[hidden email]:Gibbsdavidl/twine.git")
>> ends with
>>
>> ** building package indices
>> Error in read.table(zfile, header = TRUE, as.is = FALSE) :
>>    more columns than column names
>> ERROR: installing package indices failed
>> * removing ‘/usr/local/lib/R/site-library/twine’
>> Fehler in i.p(...) :
>>    (konvertiert von Warnung) installation of package
>> ‘/tmp/RtmpD3exKe/file730c303b4c3/twine_0.1.tar.gz’ had non-zero exit
>> status
>>
>> I found hints like
>> https://community.rstudio.com/t/lazydata-failed-for-for-package/4196 and
>> https://stat.ethz.ch/pipermail/r-help/2011-March/272829.html
>> that boil down to problems within the data subdir of the project – but
>> I cannot (and should not) edit the project, can I?
>>
>> Can anybody help me solving the problem?
>> Thank you in advance!
>> Yours, Ferri
>>
>>
>> Gesendet: Sonntag, 11. November 2018 um 15:38 Uhr
>> Von: "Peter Dalgaard" <[hidden email]>
>> An: "Ferri Leberl" <[hidden email]>
>> Cc: [hidden email]
>> Betreff: Re: [R] Line with linearly changing thickness
>> Hmm... I don't recall whether this has been packaged up, but Paul
>> Murrell talked about it at useR in Brisbane.
>>
>> https://www.youtube.com/watch?v=L6FawdEA3W0
>>
>> -pd
>>
>>> On 11 Nov 2018, at 11:44 , Ferri Leberl <[hidden email]> wrote:
>>>
>>>
>>> Dear All,
>>> I want to depict flows: At point x there is an input of a units. at
>>> point y, b units arrive.
>>> Obviously, the line thicknes can be manipulated with (a constant)
>>> cex. But I want the thickness to change linearly from ~a in x to ~b
>>> in y.
>>> Is there an out of the box solution for this?
>>> Thank you in advance!
>>> Yours, Ferri
>>>
>>> ______________________________________________
>>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]
>>>
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]
>>>
>>> and provide commented, minimal, self-contained, reproducible code.
>> --
>> Peter Dalgaard, Professor,
>> Center for Statistics, Copenhagen Business School
>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
>> Phone: (+45)38153501
>> Office: A 4.23
>> Email: [hidden email] Priv: [hidden email]
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ______________________________________________
>> [hidden email] 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.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: [FORGED] Re: Line with linearly changing thickness – installation issues

Mag. Ferri Leberl
Dear Paul,
Thank you for your help.
With your command, the package got installed immediately.
Yours, Ferri
 



Gesendet: Sonntag, 11. November 2018 um 21:05 Uhr
Von: "Paul Murrell" <[hidden email]>
An: "David Winsemius" <[hidden email]>, [hidden email]
Betreff: Re: [R] [FORGED] Re: Line with linearly changing thickness – installation issues
Hi

This should hopefully work ...

library(devtools); install_github("pmur002/vwline/pkg@v0.1")

You can also do ...

library(devtools); install_github("pmur002/gridBezier@v1.0-0")
library(devtools); install_github("pmur002/vwline/pkg@v0.2-1")

... to get the latest version.

There is more info at ...

https://www.stat.auckland.ac.nz/~paul/Reports/VWline/vwline-intro/power-curve.html

... and even more in several other reports at ...

https://www.stat.auckland.ac.nz/~paul/index.html[https://www.stat.auckland.ac.nz/~paul/index.html]

Paul

On 12/11/18 6:22 AM, David Winsemius wrote:

> I would have imagined that drawing a polygon would be the way most
> people would have attempted.
>
> Regarding Murrell's package:
>
> I thought the package name was "vwline". My attempt to install was
> unsuccessful>
>
> > devtools::install_github("pmur002/vwline")
> Error in utils::download.file(url, path, method = download_method(),
> quiet = quiet,  :
>   cannot open URL
> 'https://api.github.com/repos/pmur002/vwline/contents/DESCRIPTION?ref=master'[https://api.github.com/repos/pmur002/vwline/contents/DESCRIPTION?ref=master']
>
> > install.packages("~/vwline-0.2-1.tar.gz", repo=NULL)
> Installing package into ‘/home/david/R/x86_64-pc-linux-gnu-library/3.5.1’
> (as ‘lib’ is unspecified)
> Warning in untar2(tarfile, files, list, exdir, restore_times) :
>   skipping pax global extended headers
> ERROR: cannot extract package from ‘/home/david/vwline-0.2-1.tar.gz’
> Warning in install.packages :
>   installation of package ‘/home/david/vwline-0.2-1.tar.gz’ had
> non-zero exit status
>
>
> Furthermore, I do get the same error from attempting to install
> pkg:twine from github.
>
> -- David
>
> Doing this from an Rstudio console running R 3.5.1 in Ubuntu 18.04
>
> On 11/11/18 8:30 AM, Ferri Leberl wrote:
>> Dear All,
>> Thanks to Peter for his hint to the lwline package.
>> As a pitty, I have difficulties to get it installed, as it requires
>> https://github.com/Gibbsdavidl/twine[https://github.com/Gibbsdavidl/twine] which failes for me.
>>
>> install_github("[hidden email]:Gibbsdavidl/twine.git")
>> ends with
>>
>> ** building package indices
>> Error in read.table(zfile, header = TRUE, as.is = FALSE) :
>>    more columns than column names
>> ERROR: installing package indices failed
>> * removing ‘/usr/local/lib/R/site-library/twine’
>> Fehler in i.p(...) :
>>    (konvertiert von Warnung) installation of package
>> ‘/tmp/RtmpD3exKe/file730c303b4c3/twine_0.1.tar.gz’ had non-zero exit
>> status
>>
>> I found hints like
>> https://community.rstudio.com/t/lazydata-failed-for-for-package/4196[https://community.rstudio.com/t/lazydata-failed-for-for-package/4196] and
>> https://stat.ethz.ch/pipermail/r-help/2011-March/272829.html[https://stat.ethz.ch/pipermail/r-help/2011-March/272829.html]
>> that boil down to problems within the data subdir of the project – but
>> I cannot (and should not) edit the project, can I?
>>
>> Can anybody help me solving the problem?
>> Thank you in advance!
>> Yours, Ferri
>>
>>
>> Gesendet: Sonntag, 11. November 2018 um 15:38 Uhr
>> Von: "Peter Dalgaard" <[hidden email]>
>> An: "Ferri Leberl" <[hidden email]>
>> Cc: [hidden email]
>> Betreff: Re: [R] Line with linearly changing thickness
>> Hmm... I don't recall whether this has been packaged up, but Paul
>> Murrell talked about it at useR in Brisbane.
>>
>> https://www.youtube.com/watch?v=L6FawdEA3W0[https://www.youtube.com/watch?v=L6FawdEA3W0]
>>
>> -pd
>>
>>> On 11 Nov 2018, at 11:44 , Ferri Leberl <[hidden email]> wrote:
>>>
>>>
>>> Dear All,
>>> I want to depict flows: At point x there is an input of a units. at
>>> point y, b units arrive.
>>> Obviously, the line thicknes can be manipulated with (a constant)
>>> cex. But I want the thickness to change linearly from ~a in x to ~b
>>> in y.
>>> Is there an out of the box solution for this?
>>> Thank you in advance!
>>> Yours, Ferri
>>>
>>> ______________________________________________
>>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help][https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]]
>>>
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html][http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]]
>>>
>>> and provide commented, minimal, self-contained, reproducible code.
>> --
>> Peter Dalgaard, Professor,
>> Center for Statistics, Copenhagen Business School
>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
>> Phone: (+45)38153501
>> Office: A 4.23
>> Email: [hidden email] Priv: [hidden email]
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]
>> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] 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.