similar to: help in vectorization

Displaying 20 results from an estimated 100 matches similar to: "help in vectorization"

2006 Jul 05
1
creating a data frame from a list
Dear all, I have a list with three (named) numeric vectors: > lst = list(a=c(A=1,B=8) , b=c(A=2,B=3,C=0), c=c(B=2,D=0) ) > lst $a A B 1 8 $b A B C 2 3 0 $c B D 2 0 Now, I'd love to use this list to create the following data frame: > dtf = data.frame(a=c(A=1,B=8,C=NA,D=NA), + b=c(A=2,B=3,C=0,D=NA), + c=c(A=NA,B=2,C=NA,D=0) ) > dtf a b
2007 Jun 20
2
add line to data.frame
Dear R user, how can I update a data.frame adding new lines? I need to create a second data frame from a first one with only some of their entrys filtering the value of a specific column... How can I do this? thankyou very much in advance best regards Manuele PEsenti -- Manuele Pesenti manuele a inventati.org amicogodzilla a jabber.linux.it http://mpesenti.polito.it
2010 Mar 02
1
simple data transformation question
Hi all, I have a (hopefully) simple newbie-level question.   # I have data like this: dtf <- data.frame(read.table(textConnection("var  value   company  9887.1   company  91117.0   blaah  91.1   etc  11   etc  97111"), header=TRUE))   # I would like to have output like this (the index number may vary): var  value.1 value.2 company 9887.1 91117.0 blah  91.1 NA etc 11 97111   # I
2006 Nov 30
1
data.frame within a function (PR#9294) (cont'd)
This continues the message "data.frame within a function (PR#9294)" that was posted on 2006/10/12. Duncan Murdoch kindly replied. I'm using the current version R 2.4.0, but the same issue exists. Just copy and paste the following code under R, and compare the output of f1() and f2() and the output of f3() and f4(). Does anybody have any idea? Thanks.
2007 Apr 05
2
creating a data frame from a list
Dear all, A few months ago, I asked for your help on the following problem: I have a list with three (named) numeric vectors: > lst = list(a=c(A=1,B=8) , b=c(A=2,B=3,C=0), c=c(B=2,D=0) ) > lst $a A B 1 8 $b A B C 2 3 0 $c B D 2 0 Now, I'd love to use this list to create the following data frame: > dtf = data.frame(a=c(A=1,B=8,C=NA,D=NA), +
2006 Oct 04
1
extracting nested variances from lme4 model
I have a model: mod1<-lmer( x ~ (1|rtr)+ trth/(1|cs) , data=dtf) # Here, cs and rtr are crossed random effects. cs 1-5 are of type TRUE, cs 6-10 are of type FALSE, so cs is nested in trth, which is fixed. So for cs I should get a fit for 1-5 and 6-10. This appears to be the case from the random effects: > mean( ranef(mod1)$cs[[1]][1:5] ) [1] -2.498002e-16 > var(
2009 Jul 08
1
rsync between windows Opensolaris failures
Can anyone tell me what is wrong in this picture with error output: rsync -nvviirp --inplace harry@harvey:/cygdrive/c/Documents\ And\ Settings ./docs_settings_$(dtf) opening connection using ssh harvey -l harry rsync --server --sender -vvnpr --inplace . "/cygdrive/c/Documents And Settings" harry@harvey's password: protocol version mismatch -- is your shell clean? (see the rsync
2019 Jun 13
2
Problema de INSERT en Windows SQL
Pd: Perdón por el duplicado de mensaje, se me olvido poner el asunto al anterior y me han surgido nuevas consultas. Buenos días, llevo unos dias peleando para realizar una consulta con INSERT en Windows SQL. He probado varios paquetes de R y con ninguno lo he conseguido. Ahora mismo estoy probando con DBI y odbc. Probé con dbSendStatementy al ejecutar la consulta:
2012 Mar 08
4
Problem with a Matrix
Dear All, I have a problem in making a matrix from a data. I did a summary data from a big data frame using (ddply), the resulting table is like that: Site.No Plant.Name Cover.Percentage 1 XXX 15 1 YYY 20 2 XXX 18 2 YYY 21 3 XXX 14 3
2011 Oct 13
8
Remove specific rows in a matrix/data.frame
Hi, imagine the following matrix/data.frame Letter Number a 1 a 1 b 1 b 0 c 0 c 1 d 0 d 0 If the numbers for two identical letters are also identical then I want to remove either the first or the second row of that letter. If for a letter the numbers are 1 and 0 I want to remove the row with the 0. That means if the code works I would and up with the following matrix/data.frame Letter
2013 Feb 15
10
reading data
Hi, #working directory data1 #changed name data to data1.? Added some files in each of sub directories a1, a2, etc. ?indx1<- indx[indx!=""] lapply(indx1,function(x) list.files(x)) #[[1]] #[1] "a1.txt"??????? "mmmmm11kk.txt" #[[2]] #[1] "a2.txt"??????? "mmmmm11kk.txt" #[[3]] #[1] "a3.txt"??????? "mmmmm11kk.txt" #[[4]] #[1]
2011 Mar 06
2
How to load load multiple text files and order by id
Hello R users, I am fairly new to R and was hoping you could point me in the right direction I have a set of text files (36). Each file has only two columns (id and count) , I am trying to figure out a way to load all the files together and then have them ordered by id into a matrix data frame. For example If each txt file has : ID count id_00002 20 id_00003 3 A Merged File: ID
2012 Jul 20
2
Changing ungrouped cases to grouped cases
Hi, I have my data the following way: y A B C 0 1 1 2 0 1 2 1 1 1 1 2 0 1 1 2 1 1 1 2 1 1 2 1 0 1 2 2 . . . And so on. How can I make my data look like the following: y A B C 2 1 1 2 1 1 2 1 0 1 2 2 . . . In other words how can I change my ungrouped cases into grouped cases? Thanks! Chris [[alternative
2012 Mar 31
4
R Help
Hi, I have a polynomial of 2n^2-5n+3 and I have my n values going up in powers of 2 i.e. n=2,4,8,16?.. I wanted to fit this curve to the function A*n*log2(n) +B*n where A and B are to be found. How would i do this? Thank you Jaymin
2004 Sep 18
0
[Bug 1793] configure: WARNING: glob.h: present but cannot be compiled
https://bugzilla.samba.org/show_bug.cgi?id=1793 ------- Additional Comments From dfarning@sbcglobal.net 2004-09-17 17:07 ------- Attached are the files you suggested that I take a look at. Hope this helps. I've got a working rsync that I got from a .rpm. So, I think it can work. hmmm mybe the .rpm was build before something got bugered. Thanks -dtf -- Configure bugmail:
2005 Oct 20
5
spliting an integer
Hi there, From the vector X of integers, X = c(11999, 122000, 81997) I would like to make these two vectors: Z= c(1999, 2000, 1997) Y =c(1 , 12 , 8) That is, each entry of vector Z receives the four last digits of each entry of X, and Y receives "the rest". Any suggestions? Thanks in advance, Dimitri [[alternative HTML version deleted]]
2005 May 19
1
HasNewVoicemail not being called if user hang up after leaving VM ??
Hi, it seems if a user leaves voicemail and hangs up the call when done, then HasNewVoicemail never gets called on the next line in the context. However if they press # to finish their VM, then it moves to HasNewVoicemail and this works? eg:- ...... exten => 2002,3,VoiceMail(u${OFFICEVM}) exten => 2002,4,HasNewVoiceMail(2002) ...... exten => 2002,105, do something cos vm has been
2010 Sep 29
1
Trying to avoid loop structure
Dear R-helpers, I'm trying to associate linear coefficients (intercept and slope) to tens of thousands of observations based on a table with benchmark values. #####Example - Value table and their corresponding coefficients (intercept and slope) coef = data.frame(cbind(st=c(1:5),b = runif(5,0.3,5),a = seq(0.5,5,1)))print(coef) #Example of observations to be computedobs = runif(20,1,5)print(obs)
2010 Mar 01
1
Generating variable from 2 others in dataframe
Suppose I have the following dataframe called test: test<-data.frame(year=rep(1990:2003,5),id=gl(5,length(1990:2003)),eif=as.vector(sapply(1:5,function(z){a<-rep(0,length(1990:2003));a[sample(1:length(1990:2003),sample(1:2,1))]<-1;a}))) year id eif 1990 1 0 1991 1 0 1992 1 0 2000 1 1 1994 1 0 1995 1 0 2001 1 0 1997 1 1 .... I want to create a new variable in
2007 Nov 01
2
ACL changes on Samba NT 4.0 Member Server
I have a Samba 3.0.24-7 on Fedora 6 as a member of an Windows NT 4.0 domain, with a simple share setup with ACLs. The permissions on the share from Windows XP Pro Security tab shows Everyone, and root (Unix Group\root) without any Permissions. When trying to add permissions from XP while logged on as CPDOM+admin the error is display "Unable to save permission changes on "share