Displaying 20 results from an estimated 4000 matches similar to: "extracting object names as strings"
2001 Oct 09
3
find indices of nonzero elements
Hi,
Is there a function func(x) where x is an array such that it
returns a list of the indices of all non-zero elements of the array?
for example:
a:
1 0 0
0 0 1
0 1 0
func(a) returns two vectors r and c:
r c
1 1
2 3
3 2
daver
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|David Richmond It works on a |
+ Dept. of Sociology complex scientific
2002 Mar 20
7
how does while work
i am having some problems with a program that i am writing and i think that
knowing how the while command works will help me to figure out where i am
going wrong
*when do you get kicked out of a while loop?*
(i.e., in the following example what would the final value of 'a' be?) i
thought it would be 99 but running it in R i get 101 (and 101 for x too!)
while (x <100) {
for (i in
2001 Nov 29
3
pause/get input
Hi,
Is there a simple command to pause a script until the user hits
return? Alternatively, is there a command which prompts the user for some
input and assigns the input into a variable?
dave
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|David Richmond It works on a |
+ Dept. of Sociology complex scientific +
|Saint Mary's College
2001 Sep 28
3
evaluating the contents of a string
Hi,
suppose I do:
b <- matrix(1:9,3,3)
bname <- "b"
now
dim(b)
returns
[1] 3 3
and
dim(bname)
returns
NULL
is there a function to pass bname to such that dim returns the dimensions
of b?
like
dim(somefunc(bname))
returns
[1] 3 3
does 'somefunc' exist?
daver
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|David Richmond It
2001 Oct 16
4
Assignment of structures on a given environment
Hi,
In order to avoid deep copies by passing large arguments to functions or
returning values, I'm trying to do the assignment of variables in a
given environment. The problem is when I try to assign a structure: a
list for example.
If I have:
ind <- c("a","b")
my idea is doing something like
l <- alist()
l[ind] <- as.list(c(20,40))
in a given
2001 Sep 14
3
stuff I used to do in Matlab
Hi,
I'm new to R, and trying to map stuff I knew how to do in Matlab
to R. For instances, in matlab, sum(x) gave the column sums of
matrix(/vector) x. In R it just gives the sum of all the elements,
regardless of their form (vector or matrix). Is there a simple way to
return a vector of column sums for a matrix? Also, in Matlab binary
operators exist for concatenating a matrix onto the end or
2001 Nov 15
6
two plots in one frame
I would like to plot two different scatterplots in the same frame (say with
different colors) but everytime plot is called a new frame is created. Is
there a way around this?
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or
2002 Apr 12
2
Help
I have an adjacency matrix and I want to obtain a matrix of the minimum
paths between the nodes. Thank you
Alessandro Ambrosini
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)
2001 Sep 29
1
how much memory does one need...
to allocate 7.8 MB to a vector? (on R running on MacOS 8.6 with a 100MB
partition)
I get this error from a function which is trying to create a 1000x1000
matrix:
Error: cannot allocate vector of size 7812 Kb
the error occurs here:
dist <- as.single((t(pos)-pos)/n)
where pos is a matrix of integers, and n is the size of the first
dimension. It appears to first create a double with
2005 May 07
1
Incorrect libxml2.2.dylib version on Tiger install
Hi all,
I have just installed OSX Server 10.4 and R comes up with the
incompatible libxml library message reported by Dan Kelley a few
messages ago. Xcode 2 does not ship with Tiger Server. I installed
the X-Windows code. I can report that the version of libxml2.2 that is
installed in this case is the version 8.0.0 dylib.
[6]sboker at munimula:/usr/lib % ls -l libxml2.2*
-rwxr-xr-x 1
2004 Sep 22
5
Issue with predict() for glm models
[This email is either empty or too large to be displayed at this time]
2003 Nov 26
9
Error Message
I noticed this error message within some of my users log files;
rpc_server/srv_samr_nt.c:_samr_query_aliasmem(2626) _samr_query_aliasmem:
Not yet implemented.
Why does this mean and what do I need to do to stop this error message from
appearing.
BTW, the users all have XP machines.
Martin Stacey
IT Support Manager
Safcol Australia Pty Ltd
2004 Nov 25
2
logistic regression and 3PL model
Hello colleagues,
I am a novice with R and am stuck with an analysis I am trying to conduct.
Any suggestions or feedback would be very much appreciated.
I am analyzing a data set of psi (ESP) ganzfeld trials. The response
variable is binary (correct/incorrect), with a 25% base rate. I've looked
around the documentation and other online resources and cannot find how I
can correct for
2002 Feb 28
1
postscript output sideways
Hi,
My plots are all coming out sideways! If I do the following:
> postscript("plot1.ps",horizontal=TRUE,paper="letter")
> plot(ns,meanpl/maxvec)
> dev.off(2)
The output file has "ns" on the left and the "meanpl/maxvec" on the top!
It doesn't matter if I change the horizontal flag to FALSE.
I have noticed, however that If I create my own
2005 Feb 20
1
logistic regression and 3PL model
Hello colleagues,
This is a follow up to a question I posed in November regarding an analysis
I was working on. Thank you to Dr. Brian Ripley and Dr. John Fox for
helping me out during that time.
I am conducting logistic regression on data set on psi (ESP) ganzfeld
trials. The response variable is binary (correct/incorrect), with a 25%
guessing base rate. Dr. Ripley suggested that I
2001 Oct 14
1
recursive functions and global variables
Hi,
I am trying to write a recursive routine which passes some
variables through the function calls but also refers to some global
variables. I need the global variables because they are very big (n by n
matrices where n is <= 1000) and I don't have the huge amount of memory
needed to spawn dozens of copies of these matrices. The problem seems to
be that while variables in the root
2001 Dec 14
0
polylog
Hi,
Does R do the "PolyLog" function, also know as Jonquiere's
function: Li-n(z) = sum over k= 1 to inf. of (z^k)/(k^n) ?
dave
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|David Richmond It works on a |
+ Dept. of Sociology complex scientific +
|Saint Mary's College principle, known as |
+ Notre Dame, IN
2018 May 03
4
adding overall constraint in optim()
Hi ?
This is giving me a headache. I?m trying to do a relatively simple optimization ? actually trying to approximate the output from the Excel Solver function but at roughly 1000x the speed. ?
The optimization parameters look like this. The only trouble is that I want to add a constraint that sum(wgt.vect)=1, and I can?t figure out how to do that in optim.
Mo.vect <-
2006 Sep 04
3
Subsetting vectors based on condition
Hello,
I have a question regarding subsetting of vectors. Here's an example of
what I'm trying to do:
vect.1 <- c(76,195, 290, 380)
vect.2 <- c(63, 95, 133, 170, 215, 253, 285, 299, 325, 375)
I would like to subset vect.2 so that it has the same length as vect.1,
and its numbers are the first corresponging higher value compared to
vect.1.
The output should be:
final.output =
2008 Jun 09
1
Cross-validation in R
Folks; I am having a problem with the cv.glm and would appreciate someone
shedding some light here. It seems obvious but I cannot get it. I did read
the manual, but I could not get more insight. This is a database containing
3363 records and I am trying a cross-validation to understand the process.
When using the cv.glm, code below, I get mean of perr1 of 0.2336 and SD of
0.000139. When using a