search for: name2

Displaying 20 results from an estimated 357 matches for "name2".

Did you mean: name
2023 Apr 03
4
Simple Stacking of Two Columns
Hi R-Helpers, Sorry to bother you, but I have a simple task that I can't figure out how to do. For example, I have some names in two columns NamesWide<-data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly")) and I simply want to get a single column NamesLong<-data.frame(Names=c("Tom","Dick","Larry","Curly")) > NamesLong Names 1 Tom 2 Dick 3 Larry 4 Curly Stack produces an error NamesLong<-stack(NamesWide$Na...
2023 Apr 04
1
Simple Stacking of Two Columns
Just to repeat: you have NamesWide<-data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly")) and you want NamesLong<-data.frame(Names=c("Tom","Dick","Larry","Curly")) There must be something I am missing, because NamesLong <- data.frame(Names = c(NamesWide$Name1, NamesWide$Name2)) appears to do...
2006 Oct 09
1
patch: mailboxcasecmp()
...util.c 2006-01-13 19:00:10.000000000 -0800 +++ dovecot-1.0.beta8/src/imap/commands-util.c 2006-10-08 15:01:26.919748000 -0700 @@ -328,8 +328,8 @@ bool client_save_keywords(struct mailbox return TRUE; } -bool mailbox_equals(struct mailbox *box1, struct mail_storage *storage2, - const char *name2) +static bool _mailbox_equals(struct mailbox *box1, struct mail_storage *storage2, + const char *name2, int ci) { struct mail_storage *storage1 = mailbox_get_storage(box1); const char *name1; @@ -338,13 +338,36 @@ bool mailbox_equals(struct mailbox *box1 return FALSE; name1...
2017 Jul 16
3
Arranging column data to create plots
Dear All, I need some help arranging data that was imported. The imported data frame looks something like this (the actual file is huge, so this is example data) DF: IDKey X1 Y1 X2 Y2 X3 Y3 X4 Y4 Name1 21 15 25 10 Name2 15 18 35 24 27 45 Name3 17 21 30 22 15 40 32 55 I would like to create a new data frame with the following NewDF: IDKey X Y Name1 21 15 Name1 25 10 Name2 15 18 Name2 35 24 Name2 27 45 Name3 17 21 Name3 30 22 Name3 15 40 Name3 32 55 With the data like this I t...
2020 Jul 23
5
Off Topic bash question
...while read -r LINE do NODENAME=` echo $LINE | cut -f 1 -d ','` IP=` echo $LINE | cut -f 2 -d ','` names[index]="$NODENAME" ip[index]="$IP" index=`expr index+1` total=`expr total+1` done <<< $(cat list.txt) simple file: more list.txt name1,ip1 name2,ip2 name3,ip3 output when running: sh -x ./test_bash.sh + index=0 + total=0 + names=() + ip=() ++ cat list.txt + read -r LINE ++ echo name1,ip1 name2,ip2 name3,ip3 ++ cut -f 1 -d , + NODENAME=name1 ++ echo name1,ip1 name2,ip2 name3,ip3 ++ cut -f 2 -d , + IP='ip1 name2' + names[index]=name...
2023 Apr 04
1
Simple Stacking of Two Columns
...Heinz Tuechler Sent: Monday, April 3, 2023 4:39 PM To: r-help at r-project.org Subject: Re: [R] Simple Stacking of Two Columns Jeff Newmiller wrote/hat geschrieben on/am 03.04.2023 18:26: > unname(unlist(NamesWide)) Why not: NamesWide <- data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly")) NamesLong <- data.frame(Names=with(NamesWide, c(Name1, Name2))) > > On April 3, 2023 8:08:59 AM PDT, "Sparks, John" <jspark4 at uic.edu> wrote: >> Hi R-Helpers, >> >> Sorry to bother you, but I have a simple task th...
2006 Jan 20
3
Selecting data frame components by name - do you know a shorter way?
Hi! I suspect there must be an easy way to access components of a data frame by name, i.e. the input should look like "name1 name2 name3 ..." and the output be a data frame of those components with the corresponding names. I ´ve been trying for hours, but only found the long way to do it (which is not feasible, since I have lots of components to select): dframe[names(dframe)=="name1" | dframe=="name2&qu...
2023 Apr 03
1
Simple Stacking of Two Columns
Hi, You were on the right track using stack(), but you just pass the entire data frame as a single object, not the separate columns: > stack(NamesWide) ? values ? ind 1 ? ?Tom Name1 2 ? Dick Name1 3 ?Larry Name2 4 ?Curly Name2 Note that stack also returns the index (second column of 'ind' values), which tells you which column in the source data frame the stacked values originated from. Thus, if you just want the actual data: > stack(NamesWide)$values [1] "Tom" ? "Dick" ?&q...
2017 Jul 16
0
Arranging column data to create plots
...l if you were to use dput to give us the sample data since you say you have already imported it. > The imported data frame looks something like this (the actual file is > huge, so this is example data) > > DF: > IDKey X1 Y1 X2 Y2 X3 Y3 X4 Y4 > Name1 21 15 25 10 > Name2 15 18 35 24 27 45 > Name3 17 21 30 22 15 40 32 55 That data is missing in X3 etc, but would be NA in an actual data frame, so I don't know if my workaround was the same as your workaround. Dput would have clarified the starting point. > I would like to create a new data f...
2009 Sep 04
2
transforming a badly organized data base into a list of data frames
...d data base in Excel. Once I read it into R it looks like this (all variables become factors because of many spaces and other characters in Excel): x<-data.frame(A=c("","Name1","text1","text2","text3","","","","Name2","text1","text2","text3","","","Name3","text1","text2","text3","","Name1","text1","text2","text3",""), B=c("","",1,2,3,&quot...
2001 May 23
1
Passing a string variable to Surv
...xM3 1 2 3 4 5 6 Where M1,M2, M3 hve no similarity except they have a max string length of 7. Examples are mcw0045, adl0003, lei0101. Now, what I want to do is Function(M1, M2, M3, datafile) { xnew <- readtable(datafile) name1 <- paste("time",M1",sep"") name2 <- paste(status",M1,sep"") name3 <- paste("x",M1,sep"") fit1 <- survfit(Surv(name1,name2)~name3,data=xnew) . . repeat for M2 and M3 . . par(mfcol=c(1,3)) plot(fit1) plot(fit2) plot(fit3) } When I try to pass na...
2008 May 25
3
naming components of a list
...AM") > V [1] "Fred" "Mary" "SAM" > class(V) [1] "character" I would like to change it to a list: > L=as.list(V) > L [[1]] [1] "Fred" [[2]] [1] "Mary" [[3]] [1] "SAM" but I need to name the components as name1, name2, name3, … so it should look like this: $name1 [1] "Fred" $name2 [1] "Mary" $name3 [1] "SAM" Any help will be much appreciated Joseph [[alternative HTML version deleted]]
2010 May 26
1
Xen guest does not autostart
...entos 5.4 the last time I rebooted and experienced this problem: one of the guests does not start automatically after reboot. [root at farm1 xen]# pwd /etc/xen [root at farm1 xen]# ls -l auto total 0 lrwxrwxrwx 1 root root 8 Dec 11 17:25 name1 -> ../name1 lrwxrwxrwx 1 root root 8 May 5 21:10 name2 -> ../name2 lrwxrwxrwx 1 root root 8 Nov 26 11:43 name3 -> ../name3 lrwxrwxrwx 1 root root 6 Oct 29 2009 name4 -> ../name4 (I retyped the names there.) [root at farm1 xen]# ls -l total 88 drwxr-xr-x 2 root root 4096 Apr 3 15:15 auto -rw------- 1 root root 430 Dec 11 13:14 name1 -rw---...
2009 Jul 31
1
function problem
I have a series of columns that need to be evaluated in various tables. I need to apply a function in the following manner somers2(name1,name2). name1 is a vector of x inputs for the function which correspond to a vector of y inputs in name2. y<-rep(c(3,4,5,8),6) z<-rep(c(23,24,25,26,27,28),4) name1<-sprintf("Pred_pres_%s_indpdt[,%s,,]",x,y) name2<-sprintf("population[,%s]",z) rank<-function(i,j){ f...
2017 Jun 04
2
Warning from reshape2 when melting a data frame with uneven number of columns.
Here is a small reproducible example: data <- structure(list(V1 = structure(1:3, .Label = c("Name1", "Name2", "Name3"), class = "factor"), V2 = structure(c(1L, 3L, 2L), .Label = c("nam1", "name-1", "name_12"), class = "factor"), V3 = structure(1:3, .Label = c("nam2", "nam_34", "name-2"), class = "factor&qu...
2009 Jul 23
2
Constructing lists (yet, again)
...t apparently received no response from the oblivion of collective silence, and besides I'm also curious about the answer > From: Griffith Feeney (gfeeney at hawaii.edu) > Date: Fri 28 Jan 2000 - 07:48:45 EST wrote (to R-help) > Constructing lists with > > list(name1=name1, name2=name2, ...) > > is tedious when there are many objects and names are long. Is there > an R > function that takes a character vector of object names as an > argument and > returns a list with each objected tagged by its name? > The idiom lapply(ls(pat = "^name"),...
2012 Mar 16
1
R merge two dataframes with different row?
Hi everyone, I have a question for R code to merge. Say I have two dataframes: File1 is: V1 V2 V3 V4 1 100 101 name1 2 200 201 name2 2 300 301 name3 3 400 401 name4 3 500 501 name5 4 600 601 name6 4 700 701 name7 File2 is: V1 V2 V3 V4 1 50 55 p1 3 402 449 p2 4 550 650 p3 4 651 660 p4 2 150 250 p5 2 250 350 p6 3 450...
2009 Sep 29
3
Deleting a column in a dataframe by name
Colleagues, Hopefully a simple problem: I want to delete a column with a known name from a dataframe. I could write: FRAME <- FRAME[, names(FRAME) != NAMETODELETE] or FRAME <- FRAME[, !names(FRAME) %in% c(NAME1, NAME2, ETC)] Is there some simpler means to accomplish this? Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone: 1-866-PLessThan (1-866-753-7784) Fax: 1-415-564-2220 www.PLessThan.com
2017 Jun 04
0
Warning from reshape2 when melting a data frame with uneven number of columns.
Is this the solution? > d1<- as.data.frame(lapply(data,as.character),stringsAsFactors=FALSE) > str(d1) 'data.frame': 3 obs. of 5 variables: $ V1: chr "Name1" "Name2" "Name3" $ V2: chr "nam1" "name_12" "name-1" $ V3: chr "nam2" "nam_34" "name-2" $ V4: chr "nam3" "nam_56" "" $ V5: chr "" "name_78" "" > melt(d1,id.vars=...
2002 Oct 08
1
Some tests fail if rsync is not on path (with patch)
...t;$todir/\"" "$fromdir" "$todir" exit 0 # last [] may have failed but if we get here then we've won *** testsuite/hardlinks.test.orig Tue Oct 8 11:18:46 2002 --- testsuite/hardlinks.test Tue Oct 8 11:19:00 2002 *************** *** 31,37 **** ln "$name2" "$name3" || fail "Can't create hardlink" cp "$name2" "$name4" || fail "Can't copy file" ! checkit "rsync -aHvv \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir" exit 0 # last [...