Displaying 20 results from an estimated 1000 matches similar to: "howto import .xls and .ods"
2008 Mar 28
1
Sweave - print \n ?
Hi,
this is probably quite stupid but I have no clue
what's wrong. Let's say I write the function
hline <- function() {
cat("\\hline \n")
}
and call hline() from within a Sweave chunk. Why is
there no carriage return after the \hline in the
resulting tex file?
if I call hline() hline() in the chunk, then I get
\hline \hline
in the tex code without a linebreak in
2012 Jan 16
2
howto test a package without installation
Hi,
how can i play around with my first selfwritten package [*]
without to install it to my debian system?
I think of something like doing this:
/tmp/$ R
R version 2.11.1 (2010-05-31)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
> library(/tmp/sitools)
3 * kilo
[1] 3000
[*] https://github.com/jonasstein/sitools
--
Jonas Stein <news at
2012 Jan 18
4
R package dev: how to export constant?
Hi,
i create two constants kilo and milli in [1]. These should be available
after loading
library(sitools)
How should i export them and what have i done wrong?
(Other suggestions for improving the package are welcome too)
The ready to use .tar.gz and the source can be found on github [2,3]
kind regatds,
[1] https://github.com/jonasstein/sitools/blob/master/init.R
[2]
2007 Nov 25
2
how to wait after plotting in BATCH mode?
when i plot with the following command on console:
$ R CMD BATCH cp_messung.R
in the R-script i wrote x11() in the beginning, so it draws a nice plot on
my screen.
But sadly it disappeares after a second or two. How can i make it to wait
until i press a key or something?
thank you.
--
kind regards,
Jonas Stein <news at jonasstein.de>
2012 Feb 10
5
how to plot a nice legend?
i'd like to plot a legend in my diagram. The diagram will be included
in a TikZ LaTeX document later.
I tried the legend() function, but
- it can not find a good place it self where the legend fits
and playing around with coordinates and scaling consumes a lot time
- standard settings for the text need adjustment
(linespacing is quite large and so on)
Is there an alternative to
2009 May 08
4
howto find x value where x=max(x)
Hi,
fp is a data frame like this
,----[ fp ]
| Frequenz AmpNorm
| 1 3322 0.0379490639
| 2 3061 0.0476033058
| 3 2833 0.0592954124
| 4 2242 0.1275510204
`----
i want to find the "Frequenz" where "AmpNorm" is max.
I use this line as workaround:
PeakFreqHz = subset(fp, AmpNorm == max(AmpNorm))$Frequenz[1]
Is there something nicer?
And is there an
2012 Jan 05
4
automatic SI prefixes as ticklabels on axis
i want to plot values with frequency on a logarithmic x axis.
similar to this example that i found in the web:
http://www.usspeaker.com/jensen%20p15n-graph.gif
I would like to convert long numbers to si prefix notation
like in the example
(200000 to 200k, 35000000 to 3.5 M)
Of course i could create labels by hand, but
i have many files so i need some automatic function.
Has anyone done that
2011 Mar 02
4
Plot with same font like in LaTeX
Hi,
i want to make my plots look uniform in LaTeX documents.
- usage of the same font on axes and in legend like LaTeX uses
(for example "Computer Modern")
- put real LaTeX formulas on the axes
Have you any hints how i can achieve that?
I had no luck two years ago, but i want to try it again now.
kind regards,
--
Jonas Stein <news at jonasstein.de>
2012 Jul 11
2
nls problem: singular gradient
Why fails nls with "singular gradient" here?
I post a minimal example on the bottom and would be very
happy if someone could help me.
Kind regards,
###########
# define some constants
smallc <- 0.0001
t <- seq(0,1,0.001)
t0 <- 0.5
tau1 <- 0.02
# generate yy(t)
yy <- 1/2 * ( 1- tanh((t - t0)/smallc) * exp(-t / tau1) ) + rnorm(length(t))*0.01
# show the curve
2011 Aug 31
1
Hmisc Latex Question: column headings and Major Column Headings not properly alligned
Dear R users:
When I create a table without Major Column headings, my *regular* column headings appear correct in the typeset latex file. The major row heading and row groups are as they should.
w <- latex(mytab,title="",file="tab/my.tex",ctable=TRUE,caption="Descriptive statistics by
2009 Mar 26
3
How to rotate axis labels? 2009
Hi,
while searching for a solution i found many solutions in the internet.
But the postings seemed to be many years old and the workaround was a
dirty hack like this:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f
Now its the year 2009 and there might have been some improvement...
Does anyone know a nice and easy way to turn labels on the y axis in the
2008 Apr 04
1
How to include files in .R?
Hi,
may be its a very simple question, but i did not find any documentation
about a 'include' command or something like this.
I have to set many constants in my R-files and want to move all these to
one file, so that i can reuse it in all other R-files.
Something like
include("~/R/myconstants.R")
kind regards,
--
Jonas Stein <news at jonasstein.de>
2008 Apr 14
1
read data into list of matrix
Hi
i have a list of many files and want to load them into a list of tables, that
can be adressed with a variable 'i'.
something like
files = c("0125um","2000um","2200um","2500um","2700um")
for (i in 1:5)
{
fp[i] <- read.table( files[i] )
}
but this does not work of course.
Has anyone a good hint?
Thank you,
--
Jonas Stein
2012 Sep 11
2
how to qplot two x-axis x1:Farenheit x2:Celsius
Hi,
how can i plot two different x axis in a ggplot2 qplot?
I want to plot Farenheit and Celsius in one diagram.
x1:Farenheit x2:Celsius
kind regards,
--
Jonas Stein <news at jonasstein.de>
2006 Dec 22
1
odfWeave problem
Hi,
I'm trying to customize some formating for a table using odfWeave. I'm
having some trouble getting the formatting to work. I've defined the
following format defns:
origStyleDefs <- getStyleDefs()
StyleDefs=origStyleDefs
StyleDefs$ArialLeftBold$parentStyleName=''
StyleDefs$ArialLeftBold$type='Paragraph'
StyleDefs$ArialLeftBold$textAlign='left'
2008 May 14
1
howto get significant digits for round()
i have a table like this of an value and its tolerance
length delta-length
12.2232 0.4
123.422 0.034123
1234 12
i want to round the value to the significant digits in this way:
my-round(length,delta-length)
12.2 , 0.4
123.42 , 0.03
1234 , 12
how can i do this with R?
please CC to email,
thanks so far,
--
Jonas Stein <news at jonasstein.de>
2012 Sep 30
2
adjust font in ggplot2 to LaTeX document
Hi,
how can i adjust the font in a ggplot2 qplot so that it will look
similar to the LaTeX font?
Computer Modern Sans Serif in the same size would be nice.
My output device is
ggsave(filename="test.pdf", width=5.5, height=3, dpi=300)
and i will include the graphic with 5.5 inch in LaTeX.
I found some pages about that topic but all solutions that i found have
been very complicate
2006 Dec 23
1
bug in odfWeave
Hi,
I think there is a minor bug in odfWeave. In the function odfStyleGen,
the following line has an extra "=":
if(length(grep("italic", thisStyle$fontType)))
fontText <- c(fontText, tagattr("fo:font-style=", "italic"))
This is creating an error if some text needs to be formatted as italic,
since the corresponding entry in
2012 Feb 13
3
fit data to y~A+B*sin(C*x)
I want to fit discrete data that was measured on a wavegenerator.
In this minimal example i generate some artificial data:
testsin <- 2+ 5 * sin(1:100) #generate sin data
testsin <- testsin+ rnorm(length(testsin), sd = 0.01) #add noise
mydata <- list(X=1:100, Y=testsin) # generate mydata object
nlmod <- nls(X ~ A+B*sin(C* Y), data=mydata, start=list(A=2, B=4, C=1), trace=TRUE)
#
2007 Aug 10
2
need help to manipulate function and time interval
Hi R-users,
I have to define a noise level function L and its energy in the various
moment of the day by:
if time is between 18:00:00 and 23:59:59 then L[j] <- L[j]+5 and W <-
10^((L+5)/10)
if time is between 22:00:00 and 05:59:59 ==> L <- L+10 and W <-
10^((L+10)/10)
else
L=L and W = W
Could someone help me to realize this function please? You will find my
following