Displaying 20 results from an estimated 8000 matches similar to: "using 'sum' function in writing a function"
2006 Apr 09
1
help on using 'sum' in writng a function
Hi, I am writing a function that includes 'sum' function
such as:
f<-function(x){
c<-c(-1,0,1)
f<-sum(c+x)
}
expecting f to be -1+x+0+x+1+x=3x. But I found out that f is
sum(x). So, f is always a scalar, which means that f(c(0,1))
is not a vector as c(0,3), but 3(0+1)=3. I would like to ask
you helping me in solving this problem. I would like to
thank you in advance.
Sungsu.
2008 Apr 12
2
nonlinear curve fitting on a torus
Dear R users.
I have data observed on the surface of a torus, and
am trying to fit the nonlinear regression using
the geodesic equation on a torus. Could anyone give
me a helpful advise on this problem? I would
definitely appreicate your reply.
Sincerely,
SUNGSU KIM
[[alternative HTML version deleted]]
2011 Jan 28
6
User error in calling predict/model.frame
I want to predict values from an existing lm (linear model, e.g.
lm.obj) result in R using a new set of predictor variables (e.g.
newdata). However, it seems that because my linear models was made by
calling scale() on the target predictor that predict exits with an
error, "Error in scale(xxA, center = 9.7846094491829, scale =
0.959413568556403) : object 'xxA' not found". By
2006 May 06
2
regular expression change in R version 2.3.0?
The interpretation of regular expressions with repetition
quantifiers in the 'gregexpr' function seems to have changed
between R Version 2.2.0 and 2.3.0. The 'gsub' function, however,
gives the same results in R Versions 2.2.0 and 2.3.0. Below is
an example that demonstrates the version differences of the
'gregexpr' function. I am not sure whether this new behavior
is
2006 Mar 30
3
access list component names with lapply
I have a question regarding accessing the names of list
components when applying a function with lapply.
Here is an example that demonstrates what I'd like to do.
I have a list like this one:
mylist <- list(a=letters[1:10], b=letters[10:1], c=letters[1:3])
Now I would like to append the names of the list components to their
corresponding vectors with the c() function. I thought this
2010 Nov 16
1
Question about GLMER
Dear R Help,
I believe the glmer() function in lme4 automatically fits an
unstrucruted covariance matirx for the random effects.
Is that true? If so, do I have an option to somehow ask for a
diagonal structured covariance matrix?
Thank you,
Daniel Jeske
Department of Statistics
University of California -Riverside
[[alternative HTML version deleted]]
2006 Apr 05
0
Starting the Riverside Ruby Users Group
Do you live in Southern California''s Inland Empire?
Did you hear about the San Diego Ruby Users Group and think that''s
just too far to go for me?
Then you might be interested in forming the Riverside Ruby Users
Group. For more details see my blog,
http://anthonysseblog.blogspot.com/2006/04/forming-riversiderb.html ,
or the mailing list, https://www.cs.ucr.edu/mailman/listinfo/rug
2005 Mar 24
25
Yum problem CentOS 3.3?
I''m still using CentOS 3.3 as our install mechanism, then adding some
packages from a tarball of RPMs we need.
Then I run
# yum update yum
which sometimes takes a while.
Yesterday it took many hours. I like to run these from behind a
firewall in our office before taking the server to the datacenter, but
the delay meant a whole day''s delay in our trip to the datacenter
2009 Nov 22
1
transferring SIP call: no voice
I'm trying to connect a sip call from sipgate to Asterisk A to Asterisk
B. Both are behind NAT, but port forwarded. I get the connection, but no
voice - either in or out.
I can call on SIP from A to B (and from B to A). Do it all the time.
Asterisk A receives SIP calls from Junction and Teliax.
CLI on A looks right:
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
==
2011 Mar 11
0
is gzcon w/ urls not implemented or used differently on linux?
I wrote some code which reads a gzipped text file directly from the web with gzcon(url()) and it works perfectly on OSX, but I cannot get it to work on linux at all, trying several different R versions and linux distributions. Any ideas?
Here's an example of my code:
z <- gzcon(url("ftp://ftp-private.ncbi.nlm.nih.gov/pubchem/.fetch/8897497837079742771.sdf.gz"))
sdf <-
2011 Oct 12
2
goofy class question
Dear R People:
Here is a really goofy question.
I have some objects which have 2 classes: data.frame and ucr.
Also, the classes will always be in that order.
I have tried all sorts of things, but to no avail.
listucrModels <- function(envir=.GlobalEnv, ...) {
objects <- ls(envir=envir, ...)
if (length(objects) == 0) NULL
else objects[sapply(objects,
function(.x)
2008 Feb 25
1
version 2.5.1 and version 2.3.1
Dear R users.
I have written my R code. It runs in the version
2.3.1, but not in the version 2.5.1. The error
message is shown below.
Error in .Fortran("DEPTH", u, v, as.integer(size),
as.single(x), as.single(y), :
Fortran symbol name "depth" not in load
table
Could any one advise me what I could do to run my
code in 2.5.1?
Sincerely,
2009 Nov 16
1
1.6.0.18-rc3: SendFAX causes restart
On 1.6.0.18-rc3 using app_fax.so, spandsp-0.0.5, anytime I use SendFAX
asterisk restarts:
[Nov 15 19:00:36] VERBOSE[17013] logger.c: -- Executing
[s at fax-tx-test:1] ESC[1;36;40mNoOpESC[0;37;40m("ESC[1;35;40mSIP/nhi-rive
rside-sip-00000000ESC[0;37;40m", "ESC[1;35;40mContext
fax-tx-testESC[0;37;40m") in new stack
[Nov 15 19:00:36] VERBOSE[17013] logger.c: --
2006 Dec 01
4
YUM conflict with RHEL 4_X86_64
Hi, everyone, I have one conflict problem when I try to install Centos YUM
on RHEL 4_X 86_64.
Uname -a shows:
Linux PT3 2.6.9-42.0.0.0.1.ELsmp #1 SMP Sun Oct 15 15:13:57 PDT 2006 x86_64
x86_64 x86_64 GNU/Linux
Yum -version shows:
Repository update is listed more than once in the configuration
Repository base is listed more than once in the configuration
Repository contrib is listed
2005 Nov 23
1
Linear and cuadratic effects
I'd like to know how to obtain a table of anova of a 3^2 desing with
linear and cuadratic sum of squares because if I use "aov", this
comand only bring me the linear sum of squares:
> A<-rep(c(rep(-1,3),rep(0,3),rep(1,3)),2)
> B<-rep(rep(c(-1,0,1),3),2)
>
y<-c(1.5,1.4,0.8,3.5,2.9,1.8,4,3.8,2.7,1.2,1.3,1.2,3.2,2.5,2,4.2,3.4,3
)
>
2006 Jun 14
3
appending
All,
In the function below I have 24 individuals and 6 calculations per
individual.
The 6 calculations are collected each time in a 1:24 loop when
calculating "delta".
I'd like to collect all 144 = 24*6 calculations in one vector
("delta.patient.comb").
The function works as is via indexing, but is there an easier way to
collect the measurements via appendinng the 6
2012 Oct 03
0
optimize and mcparallel problem
Dear list,
I am running into 2 problems when using the optimize function from the
stats package (note: I've also tried unsuccessfully to use optim,
nlm, & nlminb). The second problem is caused by my solution to the
first, so I am asking if anyone has a better solution to the first
question, or if there exists a solution to the second problem. I
should also mention that what I am
2010 Dec 10
1
1.6.2.14 > 1.6.2.15: blind transfer works but not Xfer on aastra
Upgraded from 16.2.14 to 1.6.2.15 on Fedora 13, with aastra 9133i and 57i.
On 9133i and 57i:
#<extension># works for a blind transfer.
Xfer<extension>Xfer doesn't!
All this worked on 1.6.2.14.
Nothing useful on cli, verbose 3, DEBUG. Here extension 169 answers an
outside call, and tries to transfer it to 145 using the Xfer button:
-- SIP/169-0000009c answered
2003 Aug 21
2
winbindd problem with 3.0.0rc1
i've been trying to get samba 3 to join my AD domain, and have gotten stuck.
when I wbinfo -t it returns "Could not check secret"
log.winbindd says:
nsswitch/winbindd.c:
nsswitch/winbindd.c:process_loop(722)
process_loop: Invalid request size from pid 5368: 1304 bytes sent,
should be 1568
here's my smb.conf incase it matters.
# Global parameters
[global]
workgroup =
2008 Mar 10
4
internet search (not relate to Centos)
hi all, i have a little problem and seek for your advice.
search "jade sterling" on google, msn or any other, the return is:
Offering surplus bar and rod, selling to the Forging Industry, CNC
Machining Industry and Screw Machine Industry supplying hot rolled and
cold finished
i went through all my pages and can't find "Offering surplus". my
question is how do i