Displaying 20 results from an estimated 20000 matches similar to: "Taking code from packages"
2006 Jan 11
3
Regular expressions
Matching regular expressions
Dear useRs!
I have the following problem. I would like to find objects in my environment
that have two strings in it. For example, I might want to find objects that
have in their names "MY" and "TARGET". I do not care about the ordering of
these two substrings in the name, neither what is in front, behind or
between them, the only thing important
2005 Dec 22
1
Problems with passing ... to a function
Dear useRs!
I have written a function that should pass argument "m" to the next
function, however it does not! Please have a look at the function below that
shows a problem and tell me what I am missing. As you can see, the "blocks"
argument is passed corectly, while "m" is not.
Best,
Ales Ziberna
opt.par.new<-function(
#function for optimizig
2006 Jan 04
2
Putting an object in to a function that calls the current function
Hello!
I would like to put an object in to a function that calls the current
function.
I thought the answer will be clear to me after reading the help files:
?assign
?sys.parent
However it is not.
Here is an example I thought should work, however it dose not exactly:
f<-function(){s();print(a)}
s<-function()assign(x="a",value="ok",pos=sys.parent())
f() #I want to get
2005 Nov 24
4
Survreg Weibull lambda and p
Hi All,
I have conducted the following survival analysis which appears to be OK
(thanks BRipley for solving my earlier problem).
> surv.mod1 <- survreg( Surv(timep1, relall6)~randgrpc, data=Dataset,
dist="weibull", scale = 1)
> summary(surv.mod1)
Call:
survreg(formula = Surv(timep1, relall6) ~ randgrpc, data = Dataset,
dist = "weibull", scale = 1)
2005 Dec 14
2
The fastest way to select and execute a few selected functions inside a function
Dear useRs?
I have the following problem! I have a function that calls one or more
functions, depending on the input parameters. I am searching for the fastest
way to select and execute the selected functions and return their results in
a list. The number of possible functions is 10, however usually only 2 are
selected (although sometimes more, even all).
For examples, if I have function
2005 Dec 08
3
Finding all possible partitions of N units into k classes
Dear useRs!
I would like to generate a list of all possible (unique) partitions of N
units into k classes. For example, all possible partitions of 4 units into 2
classes are (I hope I have not missed anyone):
1,1,1,2 (this can be read as {1,2,3},{4})
1,1,2,1
1,2,1,1
2,1,1,1
1,1,2,2
1,2,1,2
1,2,2,1
The partitions 1,1,2,2 and 2,2,1,1 are the same and are therefore not two
unique
2006 Mar 13
1
Building help pages
Hello!
I was just wondering, why only one of my "Rd" files is converted in
"chm" format (REGE) and the other are not when installing a package? The
output from installing a package on WinXp is below.
I tried to find more information about what "chm" format actually is,
however have found none.
Best regards and thaks for any replies,
Ales Ziberna
2005 Aug 13
2
Problems runing R CMD check
Hello!
I have a problem checking the package. Firstly, I do not know how to specify
the package to check. I tied specify it by supplying the path and by runing
the R CMD check in the directory of the package.
In addition to that, I get an error bellow. Any suggestions on how to set
TMPDIR would be greatly appriciated!
C:\Ales\Statistika\Blocno modeliranje\dr\blockmodeling>R CMD check
*
2006 Feb 21
2
Convertin rows of a matrix to a list
Hello!
I would like to convert rows of a matrix to a elements of a list.
#For example, if I have
mat<-matrix(1:100,ncol=5, nrow=20)
#I can do:
list<-apply(mat,1,list)
list
#however this is not quite what I want. To get what I want, I have to do:
list<-lapply(list,function(x)x[[1]])
list
Is there a faster way?
Best regards,
Ales Ziberna
2005 Aug 26
3
Free-form to fixed-form Fortran
Hello!
I have writen some subrutines in Free-form Fortran. I would like to includ
them in a package, which I would like to build on WinXP. I have all
suggested tools/programs for bulding R packages on Windows (except latex).
What is the best way of using these subrutines? Does sombody mybe know any
translation tools for converting Free-form to fixed-form Fortran?
Thanks for any suggestions,
2005 Aug 23
5
TCITex and R
Several times my packages have fallen foul of the latex check at the
uploading-to-CRAN stage, creating extra work for Kurt Hornik. I've never
bothered trying to get latex working on my own packages (happy with
vanilla help) but am told that "latex is the closest thing to a syntax
checker for Rd files" and that I should set it up. Now, there is already
a latex on my (Windows XP)
2004 Nov 02
3
Using East-european characters in R
Does anybody know how to produce a East-European character "??" - "c with a
v-shaped hat " in R (in text or plot)?
I do know how to get "??,??" - "s,z, with a v-shaped hat", but not this one.
Thanks in advance for any suggestions,
Ales Ziberna
P.S.: I am using Windows XP and R version 1.9.1 (details below)
$platform
[1]
2004 Oct 26
1
putting legend outside ploting region
Hello!
I have created a plot and would like to put a legend in the top left corner
(above and left of plotting region), but non of the functions can plot there
(I tried 'legend', 'text', 'points', 'lines', 'mtext', 'axes',...).
I would be very grateful if someone could help me put something in that
corrner, with any fuction.
Thanks,
Ales Ziberna
2005 Jan 11
2
Changes in expression in R 2.0.1
Hello!
plot(1:10,main=expression(1 <= "m" <= 5))
The above command works perfectly in R 1.9.1 but returns an error in R 2.0.1
This is documented in NEWS for R 2.0.0 (or ONEWS in R 2.0.1) and it is said:
o R no longer accepts associative use of relational operators.
That is, 3 < 2 < 1 (which used to evalute as TRUE!) now causes
a syntax error. If this
2005 Aug 02
1
Putting all elementes of the list in an enviorment of a function
Hello!
I have two functions.
The first one prepares the arguments for the second one. What is the best
way to put all resoults of the first one into the second one? I tried
attach, however the object in the "main" enviorment have a priority over the
ones in list. An example is at the end.
Thanks in advance for any suggestions!
Ales Ziberna
For example - I would like to use just
2005 Dec 08
1
Listing all possible samples of size n form a population of size N
Dear useRs!
I would like to list all possible samples of size n form a population of
size N. Obviously, N must be small (up to 20??) for this to be possible.
For example, let say that N = 3 and n = 2. Therefore, we can say we have
units 1, 2 and 3. I believe all possible samples are : {1,2},{2,3} and
{1,3}.
I would like to emphasize that I am not looking for the number of different
2006 Jan 08
1
Clustering and Rand Index - VS-KM
Dear WizaRds,
I have been trying to compute the adjusted Rand index as by Hubert/
Arabie, and could not correctly approach how to define a partition
object as in my last request yesterday.
With package fpc I try to work around the problem, using my original data:
mat <- matrix( c(6,7,8,2,3,4,12,14,14, 14,15,13,3,1,2,3,4,2,
15,3,10,5,11,7,13,6,1, 15,4,10,6,12,8,12,7,1), ncol=9, byrow=T )
2006 Jan 30
2
R on dual-core machines
Dear expeRts!
I'm thinking of buying a new computer and am considering dual-core
processors, such as AMD Athlon64 X2. Since I'm not a computer expert, pleas
forgive me if some of my questions are silly.
First, am I correct that using a dual-core processor is (for R point of
view) the same as using a computer with two processors?
If that is true, the posts I found on the list imply that
2004 Oct 27
4
ploting axes and rotating strings
Hello!
I have two question that rose from trying to tacle the same problem in two
differnet ways.
What I want to do is to plot axes (only values or labels, no tick marks) in
such a way that 'cex' can be very small, text can be perpendicular to the
axis (as in axis(las=2) ) and the text is stil at the right position.
Let me demonstrate with a small example:
2005 Feb 04
5
How to access results of survival analysis
Hello,
it seems that the main results of survival analysis with package survival
are shown only as side effects of the print method.
If I compute e.g. a Kaplan-Meier estimate by
> km.survdur<-survfit(s.survdur)
then I can simply print the results by
> km.survdur
Call: survfit(formula = s.survdur)
n events median 0.95LCL 0.95UCL
100.0 58.0 46.8 41.0 79.3
Is