Displaying 20 results from an estimated 6000 matches similar to: "How to automate the detection of break points for use in cut"
2009 Nov 30
3
Question about output from optim
Dear R-users,
I am trying to port to R something that I wrote in Matlab to perform model
parameter optimization using the Nelder-Mead simplex method (fminsearch). I
read the help on ?optim (which seems to be the way to go) as well as a bunch
of posts on the topic, but I would like to make sure about something before
I spend to much time trying to reproduce something that is not possible. The
2011 Aug 31
3
How to modify the dot-dot-dot argument using level names instead of position
Dear R-users,
In the R internals manual, it is said that one can extract the
elements of the dot-dot-dot argument using the special symbols ..1 or
..2. It seems to work just fine but I was wondering if there is a way
one can extract or modify the content of the dot-dot-dot argument
using a level name instead of its position?
For instance, assuming that list(...) returns:
$a
[1] 1 2 3 4 5
2011 Oct 19
2
How to call a function defined within another function
Dear R-users,
I would need some advices on the proper way to call a particular function.
This function is called scope.char and it is embedded in the step.gam
function from the gam package. I am trying to call scope.char directly in a
script but I did not find the proper way to do so. Is this even possible? If
so, what is the proper syntax?
Thank you for your time and help.
Sebastien
2011 Jan 04
4
Listing of available functions
Dear R-users,
Is there a easy way to access to a complete listing of available functions
from a R session? The help.start() and ? functions are great, but I feel
like they require the user to know the answer in advance (especially with
respect to function names)... I could not find a easy way to simply browse
through a list of functions and randomly pick one function to see what is
does.
Is
2007 Aug 28
6
Factor levels
Dear R-users,
I have found this not-so-recent post in the archives -
http://tolstoy.newcastle.edu.au/R/devel/00a/0291.html - while I was
looking for a particular way to reorder factor levels. The question
addressed by the author was to know if the read.table function could be
modified to order the levels of newly created factors "according to the
order that they appear in the data
2011 Apr 19
1
Define ylim in lattice plot based upon panel function output
Dear R-users,
By default, the xyplot function automatically defines the axis ranges based
upon the content of y and x variables. However, when one includes some calls
to other panel.<something> functions in the panel argument, the results
might be out of range and not show up in the final graphs (see lower ends of
the loess line in the following example). Is there a way one can capture the
2010 Apr 14
2
R package documentation
Dear R users,
I am currently writing the documentation for my first package. I have
created a short user manual using sweave/pdflatex which is distinct from the
manual/summary-of-package-functions created by R CMD CHECK. I was wondering
how could I seamlessly combine both documents.
Thanks for your help
Sebastien
[[alternative HTML version deleted]]
2010 Mar 17
2
Sweave and kile
Dear R-users,
I want to give a try to Sweave and Latex but I am having some problems
compiling my .Rnw files within Kile. I have followed the recommendations
given in http://tolstoy.newcastle.edu.au/R/e5/help/08/10/4277, but they do
not seem to address my particular problem.
I am using R 2.11.0 and Kile v 2.0.83 on an OpenSUSE11.2 installation (KDE
4.3 environment). According to the log (see
2018 Mar 12
7
Equivalent of gtools::mixedsort in R base
Hi,
Searching for functions that would order strings that mix characters and numbers in a "natural" way (ie, "a1 a2 a10" instead of "a1 a10 a2"), I found the mixedsort and mixedorder from the gtools package.
Problems:
1- mixedorder does not work in a "do.call(mixedorder, mydataframe)" call like the order function does
2- gtools has not been updated in 2.5
2009 Feb 03
2
Numeric class and sasxport.get
Dear R-users,
The sasxport.get function (from the Hmisc package) automatically defines
the class of imported variables. I have noticed that the class of
theoretically numeric variables is simply "labelled", although character
variables might end up been defined as "labelled" "Date" or "labelled"
"factor".
Is there a way to tell sasxport.get to
2018 Apr 09
3
Question about subset
Hi,
The help page for subset states "subset: logical expression indicating elements or rows to keep: missing values are taken as false."
Before I try to re-invent the wheel, I would like to know if one of the base or recommended packages would contain a variant of the subset function that would consider missing values as true.
Thanks
2009 May 14
1
Problem with viewports, print.trellis and more/newpage
Dear R-users,
I have got the following problem. I need to create 4x2 arrays of
xyplot's on several pages. The plots are created within a loop and
plotted using the print function. It seems that I cannot find the proper
grid syntax with my viewports, and the more/newpage arguments.
The following script is a simplification but hopefully will suffice to
illustrate my problem. Any suggestion
2009 Apr 28
1
Understanding padding in lattice
Dear R-users,
I am trying to understand what the different padding arguments in
trellis.par.set are exactly controlling the space around lattice plots.
I have used the following code as a basis for testing but it did not
really help me to visualize how the value of each argument changes the
margins and the plotting area. I guess a better way to visualize the
effects of these padding items
2009 Apr 20
3
How to force axis to have the same range
Dear R-users,
I am trying to produce (standard and trellis) scatterplots which use the
same range of the x and y axes. In addition, I would like the plots to
be physically square. Is there one or more specific argument(s) to plot
and xyplot what would do that? I have looked at various combinations of
asp and pin value, but could not get what I wanted..
Thank you in advance for your help
2018 Mar 12
0
Equivalent of gtools::mixedsort in R base
1- mixedorder does not work in a "do.call(mixedorder, mydataframe)"
call like the order function does
This is tangential, but do.call(order, mydataframe) is not safe to use in a
general purpose function either - you need to remove the names from
the second argument:
> d <- data.frame(method=c("New","New","Old","Old","Old"),
2018 Apr 09
0
Question about subset
Sent from my iPhone
> On Apr 8, 2018, at 9:06 PM, Sebastien Bihorel <sebastien.bihorel at cognigencorp.com> wrote:
>
> Hi,
>
> The help page for subset states "subset: logical expression indicating elements or rows to keep: missing values are taken as false."
>
> Before I try to re-invent the wheel, I would like to know if one of the base or recommended
2009 Aug 21
2
Problem with passing a string to subset
Dear R-users,
The following question bothered me for the whole afternoon: how can one
pass a string as the conditioning argument to subset? I tried plain
mystr, eval(mystr), expression(mystr), etc... I don't to be able to find
the correct syntax
> foo <- data.frame(a=1:10,b=10:1,c=rep(1:2,5))
> mystr<-"c==1"
> subset(foo,c==1)
a b c
1 1 10 1
3 3 8 1
5 5 6
2018 Mar 12
0
Equivalent of gtools::mixedsort in R base
split any mixed columns into letter and number columns
and then order can be used on that:
DF <- data.frame(x = c("a10", "a2", "a1"))
o <- do.call("order", transform(DF, let = gsub("\\d", "", x),
no =
as.numeric(gsub("\\D", "", x)),
2018 Mar 12
0
Equivalent of gtools::mixedsort in R base
???
> y <- sort( c("a1","a2","a10","a12","a100"))
> y
[1] "a1" "a10" "a100" "a12" "a2"
> mixedsort(y)
[1] "a1" "a2" "a10" "a12" "a100"
**Please read the docs!** They say that mixedsort() and mixedorder() both
take a **single
2009 Aug 01
3
Transparency and trellis device
Dear R-users,
I am trying to produce trellis (png, or jpeg) graphs with transparent background, but I cannot manage to make that happen. I tried to play around with themes but to no avail. Any advise on the following example will be greatly appreciated:
Thank you
Sebastien
####
library(lattice)
df <- data.frame(a=rep(1:4,4), b=rep(1:4,4), c=rep(1:4,each=4))
settings <- standard.theme()