Skip to content

Writing a hyperlink to a csv file

7 messages · Brian Smith, John Kane, Jeff Newmiller +2 more

#
Well you can write it there but it won't do anything until read into some software that can interpret it as a url.  A csv file is just plain text.

John Kane
Kingston ON Canada
____________________________________________________________
Send your photos by email in seconds...
TRY FREE IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if3
Works in all emails, instant messengers, blogs, forums and social networks.
#
Le 15/03/13 12:53, Brian Smith a ?crit :
The browseURL() function open your internet browser with the url 
indicated as parameter:
browseURL("http://www.r-project.org")

But I am not sure how you want call it. You should be more precise about 
the context you want to use it.
For example:

links <- data.frame(c(' for Google', ' for Bing'),
                c("http://www.google.com", "http://www.bing.com"),
                     stringsAsFactors = FALSE)
cat("Choose an option:\n", paste(1:2, links[,1],"\n"))
f<-scan(nmax=1, quiet=TRUE)

browseURL(links[f,2])

Sincerely
Marc
#
What Excel does or does not recognize as a url in any particular instance is up to Excel. The CSV format itself has no concept of markup that would allow you to convey this idea. HTML does, and I think Excel can import HTML, but I have never tried intentionally using HTML as a data exchange format for Excel.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
Brian Smith <bsmith030465 at gmail.com> wrote:

            
#
Le 16/03/13 15:42, Jeff Newmiller a ?crit :
I confirm that an URL is not recognized as url if in .csv file.
The solution if to generate .xml file in R in XML pakage and read it in 
Excel.

The .xml file should be like:
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet">
  <Worksheet ss:Name="TEST">
   <Table>
    <Row ss:Index="3">
     <Cell ss:Index="2" ss:HRef="http://www.google.com"><Data 
ss:Type="String">http://www.google.com</Data></Cell>
    </Row>
   </Table>
  </Worksheet>
</Workbook>

Sincerely
Marc
1 day later
#
Besides what others have suggested, there are at some packages for writing
Excel files directly, and either of those might have a way to write
something that Excel will recognize as a hyperlink.

xlsx, XLConnect are both Java-based; I would start with these.

-Don