[R] knitr

2012-08-30 Thread Sven D
Hello,

after trying to convert to pdf using knitr, I get the following error
messages from the error log:

C:/Users/duve/Documents/plots2.tex:5: LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H return  for immediate help
You're in trouble here.  Try typing  return  to proceed.
If that doesn't work, type  X return  to quit.


Has anyone a clue what the problem might be?


Thanks


Sven






--
View this message in context: http://r.789695.n4.nabble.com/knitr-tp4641843.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.


[R] Compilation Error with Rcpp

2012-07-15 Thread Sven D
Hello,

I am trying to reproduce a code example from 
http://www.babelgraph.org/wp/?p=358 babelgraph  when compiling the function
to call the C++ code I get the following error:

Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! 
In addition: Warning message:
running command 'C:/PROGRA~1/R/R-215~1.0/bin/i386/R CMD SHLIB
file141c7ac23195.cpp 2 file141c7ac23195.cpp.err.txt' had status 1 

Has anyone an idea what this means? Its not clear to me what the error would
be. I doubt its a source code error, but am happy to provide the source if
necessary. My sessioninfo:

R version 2.15.0 (2012-03-30)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United
Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
   
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base 

other attached packages:
[1] inline_0.3.8 Rcpp_0.9.10  plyr_1.7.1  

loaded via a namespace (and not attached):
[1] tools_2.15.0


Thanks


Sven





--
View this message in context: 
http://r.789695.n4.nabble.com/Compilation-Error-with-Rcpp-tp4636522.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.


Re: [R] Problems installing Packages

2012-06-04 Thread Sven D
Thanks for the replies, 

1st, installing the BLAS library indeed worked out, and I was able to load
the packages.

2nd, I was trying to build from repository directly. But even worse, I
cannot tell you if i touched the BLAS linker flags, BUT there seem to be
more problems of a similar nature, ie. I am trying to install a package
which utilises Java, and when it tests during installation if it can compile
Java, it failes and aborts the installation. Since I did this on the linux
console, I cant copy and paste the error into this message, but it clearly
is missing the link to /javac and /javah. 

i'll type it down anyway:

checking Java Support in R... configure: Error: cannot determine complete
Java config
JAVA_HOME: usr/lib/jvm/java-6-openjdk-i386/jre
JAVA: usr/bin/java
JAVAC:
JAVAH:
JAVA_CPPFLAGS:
JAVA_LIBS: ...

Running javareconf did not show any results, although java is installed
correctly through the ubuntu software center, supposing that works without
errors.

The package I am failing with is StatET for R: 

install.packages(c(rj, rj.gd),
repos=http://download.walware.de/rj-1.1;)

It fails trying to compile Java, and aborts.

I am on R 2.15 and ubuntu 12.04 and java6openjdk

thanks







--
View this message in context: 
http://r.789695.n4.nabble.com/Problems-installing-Packages-tp4632217p4632288.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.


Re: [R] Help with this web scrape function

2012-06-03 Thread Sven D
Would like to see this at the top again, as I think it did not get pick up
when I posted it initially.

Apologies, last try.




--
View this message in context: 
http://r.789695.n4.nabble.com/Help-with-this-web-scrape-function-tp4632137p4632169.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.


[R] Problems installing Packages

2012-06-03 Thread Sven D
Hello, 

I am going through Zhao's RDataMining PDF, and to redo all the graphics on
my computer, I need several packages, 'coin' and 'party' to name two.

I get the following error:

 install.packages(coin)
Installing package(s) into ‘/home/sven/R/i686-pc-linux-gnu-library/2.15’
(as ‘lib’ is unspecified)
trying URL 'http://cran.ma.imperial.ac.uk/src/contrib/coin_1.0-21.tar.gz'
Content type 'application/x-gzip' length 903944 bytes (882 Kb)
opened URL
==
downloaded 882 Kb

* installing *source* package ‘coin’ ...
** package ‘coin’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG  -fpic  -O3 -pipe  -g  -c
Classes.c -o Classes.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG  -fpic  -O3 -pipe  -g  -c
Helpers.c -o Helpers.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG  -fpic  -O3 -pipe  -g  -c
LinearStatistic.c -o LinearStatistic.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG  -fpic  -O3 -pipe  -g  -c
StreitbergRoehmel.c -o StreitbergRoehmel.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG  -fpic  -O3 -pipe  -g  -c
vandeWiel.c -o vandeWiel.o
gcc -std=gnu99 -shared -o coin.so Classes.o Helpers.o LinearStatistic.o
StreitbergRoehmel.o vandeWiel.o -lblas -lgfortran -lm -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lblas
collect2: ld returned 1 exit status
make: *** [coin.so] Error 1
ERROR: compilation failed for package ‘coin’
* removing ‘/home/sven/R/i686-pc-linux-gnu-library/2.15/coin’
Warning in install.packages :
  installation of package ‘coin’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpYPqZgS/downloaded_packages’

My system session info is as follows:

R version 2.15.0 (2012-03-30)
Platform: i686-pc-linux-gnu (32-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8   LC_NUMERIC=C  
 [3] LC_TIME=en_GB.UTF-8LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=en_GB.UTF-8LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=C LC_NAME=C 
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] stats graphics  grDevices utils datasets  methods  
[7] base 

loaded via a namespace (and not attached):
[1] tools_2.15.0


I do not have a problem loading it on my windows PC. Anyone having similar
experience, and perhaps know the solution? Furthermore, package 'RHTMLForms'
from Omegahat I could only install on the ubuntu computer and not on the
windows computer. Anyone know the reason why? Perhaps this is not even an R
question, but any hint would be great.

Thanks



Sven


--
View this message in context: 
http://r.789695.n4.nabble.com/Problems-installing-Packages-tp4632217.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.


[R] Help with this web scrape function

2012-06-01 Thread Sven D
Hello,

I am looking to scrape this Webpage: 
http://toast.gasunie.de/gud/search.aspx?soid=GUDlang=de

The page uses the method POST, it contains various HTML Forms, mostly
lists and a couple of radio buttons. After submit, I should get forwarded to
a new page. Which selections are being made in the forms does not really
matter, I get quite far, pls see the code:

library(RCurl)
library(RHTMLForms)
library(XML)

pageForms =
getHTMLFormDescription(http://toast.gasunie.de/gud/search.aspx?soid=GUDlang=de;)

fun = createFunction(pageForms[[1]])

retSubmit = fun('ctl00$MainContent$GasQuality' = H,
'ctl00$MainContent$PointList' = H071, 'ctl00$MainContent$PointType' =
EN, 'ctl00$MainContent$Publishers' = HourValues,
'ctl00$MainContent$ListHourValues' = -1,
'ctl00_MainContent_webDatePickerFrom_input' = 01.06.2012,
'ctl00_MainContent_webDatePickerTo_input' = 01.06.2012)

retPage = htmlTreeParse(retSubmit, asText = TRUE)
retPage


This is how far I get: All HTML Forms are being selected correctly with the
exception of 'ctl00$MainContent$ListHourValues'. My question is, why is this
function not correctly electing the ListHourValues? Also I think that the
function is actually not submitting the Form, because if one would submit
the Form 'by Hand' without electing the ListHourValues the page would return
MessageBox containg an error.

So the function basically returns the original page with the Forms being
selected to the right values, but it doesnt take the next step to return the
final result. Is it possible that I might have to pack the function
retSubmit into a postForm() function?

Best


Sven




--
View this message in context: 
http://r.789695.n4.nabble.com/Help-with-this-web-scrape-function-tp4632137.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.


[R] RCurl postForm() not working for me

2012-05-28 Thread Sven D
Hello,

I am trying the postForm() function on a very simple webpage:

http://www.colby.edu/chemistry/PChem/Hartree.html

I am simply trying to fill the Hartrees text form with the value 100.
But running this:

url = http://www.colby.edu/chemistry/PChem/Hartree.html;

test = postForm(url, H=100)

cat(test, file = test.html) 
shell.exec(test.html)

returns a identical webpage with an empty htmlForm, so no change.

Why is this not working? I have tried postForm() on several other pages with
the same results. I do get getForm going though. 

Anybody ANY experience with these RCurl functions, please help. ANY input is
appreciated. The example functions in the package dont seem to work at all
for postForm() I think all pages are outdated, I also couldnt find any plain
documentation on omegahat.org, cant load the html pages.

Best


Sven

--
View this message in context: 
http://r.789695.n4.nabble.com/RCurl-postForm-not-working-for-me-tp4631608.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.


Re: [R] Problem with readHTMLTable

2012-05-27 Thread Sven D
Thanks Michael, thanks Arun,

silly enough, I actually had to restart the whole thing. And the function
now performs pretty well.

Many thanks



Sven



--
View this message in context: 
http://r.789695.n4.nabble.com/Problem-with-readHTMLTable-tp4631439p4631498.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.


[R] Webscraping Data RCurl

2012-05-27 Thread Sven D
Hello,

I am trying to gather data from the following page:

http://toast.gasunie.de/Pages/search.aspx?lang=ensoid=GUD

I am trying to get hourly data. I did the following:

url = http://toast.gasunie.de/Pages/search.aspx?lang=ensoid=GUD;
getFormParams(url)

fair enough, this did not return any sensible name=value parameters I could
use. I then looked into the HTML code to find name=value parameters that
would help me. I found the following name=value pairs, and set:

today = format(Sys.time(), %d.%m.%Y)

ctl00_MainContent_webDatePickerFrom_DrpPnl1_DP_CAL_ID_1=today,
ctl00_MainContent_webDatePickerTo_DrpPnl2_DP_CAL_ID_2=today
GasQuality=H, 
PointType=EN, 
PointList=H070, 
Publishers=HourValues, 
ListHourValues=HTLF, 
Submit=Weiter

So I went on and tried getForm() and postForm() with the above parameters,
but it did not show any success. So I THINK the problem is that the
webapplication is returning the table on a different URL as the one above,
please have a quick try with the webapplication. How can I come by this
problem?

Best, and thanks


Sven






--
View this message in context: 
http://r.789695.n4.nabble.com/Webscraping-Data-RCurl-tp4631500.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.


[R] Problem with readHTMLTable

2012-05-26 Thread Sven D
Hello All,

i was trying to simply run the readHTMLTable on the example published in the
package. And on a page I was working on. So running:

u = http://en.wikipedia.org/wiki/List_of_countries_by_population;
tables = readHTMLTable(u)

returns the following error:

Error in tb[[thead]] : subscript out of bounds


looking up this error on the web, didnt give me any hint. Is something wrong
with this function?


this is my sessioninfo:

 sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United
Kingdom.1252LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=CLC_TIME=English_United
Kingdom.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base 

other attached packages:
 [1] XML_3.9-4.1  RCurl_1.91-1.1  
bitops_1.0-4.1   PerformanceAnalytics_1.0.3.2
 [5] quantstrat_0.6.4 blotter_0.8.4   
FinancialInstrument_0.13.6   quantmod_0.3-17 
 [9] Defaults_1.1-1   TTR_0.21-0   xts_0.8-2
   
zoo_1.7-6   

loaded via a namespace (and not attached):
[1] grid_2.14.1IBrokers_0.9-3 lattice_0.20-0 tools_2.14.1  

Many thanks 



Sven




--
View this message in context: 
http://r.789695.n4.nabble.com/Problem-with-readHTMLTable-tp4631439.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.