similar to: split / lapply over multiple columns

Displaying 20 results from an estimated 10000 matches similar to: "split / lapply over multiple columns"

2010 Jul 20
1
Error using sqldf
Hi, I am running a query using sqldf() [package : sqldf]. The query is:- userid <- 5 taskid <- 5 tab1 <- fn$sqldf("SELECT tobiiEvents.data1, tobiiEvents.data2, events.`timestamp` as tobiiTime FROM tobiiEvents INNER JOIN events ON events.eventid = tobiiEvents.eventid WHERE tobiiEvents.subtype = 'MOUSE' AND tobiiEvents.userid = 5 AND tobiiEvents.taskid = 5 ORDER BY
2003 Aug 25
2
SetVar on sample.call
Hi all!! Does anyone have a short example or even better - a working AGI script that uses "GET VARIABLE' from a /var/spool/asterisk/outgoing call that uses "SetVar"? Here's what I've tried with no luck so far: sample.call ================= Channel: SIP/1000 MaxRetries: 2 RetryTime: 60 WaitTime: 30 Application: Agi Data: playTasks.agi Callerid: Nightly Processor
2010 Apr 16
4
score counts in an aggregate function
Dear R-Users, I have a big data set "mydata" with repeated observation and some missing values. It looks like the format below: userid sex item score1 score2 1 0 1 1 1 1 0 2 0 1 1 0 3 NA 1 1 0 4 1 0 2 1 1 0 1 2 1 2 NA 1 2 1 3 1
2006 Dec 15
1
Switching labels on a factor
Hi All, I'm perplexed by the way the unclass function displays a factor whose labels have been swapped with the relevel function. I realize it won't affect any results and that the relevel did nothing useful in this particular case. I'm just doing it to learn ways to manipulate factors. The display of unclass leaves me feeling that the relevel had failed. I've checked three books
2007 Feb 13
1
Passing Arrays in recursive functions.
ok, I''m still new to ruby and new to rails. what I have is a task database that acts_as_tree a task can have a children an those children are full tasks so they can have children of their own, Tasks can only be completed if they have no children, a task with children is only completed if all its children are done. this much I have working, I''m trying to add some Ajax support for
2007 Apr 09
3
do.call vs. lapply for lists
Hi All, I'm trying to understand the difference between do.call and lapply for applying a function to a list. Below is one of the variations of programs (by Marc Schwartz) discussed here recently to select the first and last n observations per group. I've looked in several books, the R FAQ and searched the archives, but I can't find enough to figure out why lapply doesn't do what
2012 Jan 19
2
Reading in tab (and space) delimited data within a script XXXX
Hello everyone, I use Bob Muenchen's approach for reading in "in-stream" (to use SAS parlance) delimited data within a script. This works great: mystring <- "id,workshop,gender,q1,q2,q3,q4 1,1,f,1,1,5,1 2,2,f,2,1,4,1 3,1,f,2,2,4,3 4,2, ,3,1, ,3 5,1,m,4,5,2,4 6,2,m,5,4,5,5 7,1,m,5,3,4,4 8,2,m,4,5,5,5" mydata <- read.table( textConnection(mystring),
2006 Dec 18
1
Applying variable labels across a data frame
Hi All, I'm working on a class example that demonstrates one way to deal with factors and their labels. I create a function called myLabeler and apply it with lapply. It works on the whole data frame when I subscript it as in lapply( myQFvars[ ,myQFnames ], myLabeler ) but does not work if I leave the [] subscripts off. I would appreciate it if anyone could tell me why. The program below
2007 Nov 24
2
'Split' character
Dear R-users, The following code splits a very simple dataframe into a list, each element of the list being one line of the dataframe. You will see that the split function names each element of the list by using uses the content of a and b and merging them with a "." character. Is there a way to customize this character? a<-1:10 b<-21:30 mydata<-data.frame(a,b)
2011 Jun 20
2
Replace selected columns of a dataframe with NA
I am using the following command to replace all the missing values and assorted typos in a dataframe with NA: mydata[mydata>80]=NA The problem is that the first column contains values which should be more than 80, so really I want to do it just for mydata[,2:length(mydata)] I can't seem to re-write the code to fit: mydata[,2:length(mydata)>80]=NA # no error message, but doesn't
2016 Feb 29
2
docker 1.10.2 available
Docker 1.10.2 has just been built for virt7-docker-common-candidate https://cbs.centos.org/koji/taskinfo?taskID=78901 Please give it a shot and lemme know if I can proceed with releasing it. Thanks, -- Lokesh Freenode: lsm5 GPG: 0xC7C3A0DD -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not
2017 Jun 18
0
R_using non linear regression with constraints
> On Jun 18, 2017, at 6:24 AM, Manoranjan Muthusamy <ranjanmano167 at gmail.com> wrote: > > I am using nlsLM {minpack.lm} to find the values of parameters a and b of > function myfun which give the best fit for the data set, mydata. > > mydata=data.frame(x=c(0,5,9,13,17,20),y = c(0,11,20,29,38,45)) > > myfun=function(a,b,r,t){ > prd=a*b*(1-exp(-b*r*t)) >
2007 Aug 06
3
Error in using nlevels in apply function
Dear R users, I am currently trying to create my first personnal function and use it with the apply function. The purpose of this function is to create a vector summarizing the number of levels in a given selection of data.frame columns. I tried to transpose the indexation method used by the nlevels function but it doesn't seem to work. I did not find anything uesful in the archives so
2007 Nov 24
1
'Split' chracter
Dear R-users, The following code splits a very simple dataframe into a list, each element of the list being one line of the dataframe. You will see that the split function names each element of the list by using uses the content of a and b and merging them with a "." character. Is there a way to customize this character? a<-1:10 b<-21:30 mydata<-data.frame(a,b)
2017 Jun 18
0
R_using non linear regression with constraints
I ran the following script. I satisfied the constraint by making a*b a single parameter, which isn't always possible. I also ran nlxb() from nlsr package, and this gives singular values of the Jacobian. In the unconstrained case, the svs are pretty awful, and I wouldn't trust the results as a model, though the minimum is probably OK. The constrained result has a much larger sum of squares.
2016 Mar 01
2
docker 1.10.2 available
On Tue, Mar 01, 2016 at 12:43:32PM -0500, Jason Brooks wrote: > I'm getting this dep error trying to install this: > > Error: Package: 1:docker-1.10.2-5.git0f5ac89.el7.x86_64 (virt7-docker-common-candidate) > Requires: selinux-policy >= 3.13.1-114 > Removing: selinux-policy-3.13.1-60.el7.noarch (@anaconda) > selinux-policy =
2017 Jun 18
3
R_using non linear regression with constraints
I am not as expert as John, but I thought it worth pointing out that the variable substitution technique gives up one set of constraints for another (b=0 in this case). I also find that plots help me see what is going on, so here is my reproducible example (note inclusion of library calls for completeness). Note that NONE of the optimizers mentioned so far appear to be finding the true best
2017 Jun 18
3
R_using non linear regression with constraints
https://cran.r-project.org/web/views/Optimization.html (Cran's optimization task view -- as always, you should search before posting) In general, nonlinear optimization with nonlinear constraints is hard, and the strategy used here (multiplying by a*b < 1000) may not work -- it introduces a discontinuity into the objective function, so gradient based methods may in particular be
2017 Jun 18
2
R_using non linear regression with constraints
I am using nlsLM {minpack.lm} to find the values of parameters a and b of function myfun which give the best fit for the data set, mydata. mydata=data.frame(x=c(0,5,9,13,17,20),y = c(0,11,20,29,38,45)) myfun=function(a,b,r,t){ prd=a*b*(1-exp(-b*r*t)) return(prd)} and using nlsLM myfit=nlsLM(y~myfun(a,b,r=2,t=x),data=mydata,start=list(a=2000,b=0.05), lower = c(1000,0),
2009 Feb 23
0
[LLVMdev] 2.5 Pre-release1 available for testing
On Fri, Feb 6, 2009 at 8:42 PM, Tanya Lattner <tonic at nondot.org> wrote: > LLVMers, > > The 2.5 pre-release is available for testing: > http://llvm.org/prereleases/2.5/ > I'm updating the Fedora packaging of LLVM, and with the 02/20 prerelease it fails to build on ppc64: http://koji.fedoraproject.org/koji/taskinfo?taskID=1148023 make[1]: Entering directory