search for: id_2

Displaying 18 results from an estimated 18 matches for "id_2".

Did you mean: id2
2018 Jan 08
4
Replace NAs in split lists
...ata frame shown below has a column named ID which has 2 variables a and b; i want to replace the NAs on the Value column by 2, which is the only numeric entry, for ID=a and by 5 for ID=b. I worked out the solution but could not replace the results in the split lists. Original dataframe , df1 ID ID_2 Firist Value 1 a aa TRUE 2 2 a ab FALSE NA 3 a ac FALSE NA 4 b aa TRUE 5 5 b ab FALSE NA Sdf1 $a ID ID_2 Firist Value 1 a aa TRUE 2 2 a ab FALSE NA 3 a ac FALSE NA $b ID ID_2 Firist Value 4 b aa TRUE 5 5 b ab FALSE NA D...
2018 Jan 08
3
Replace NAs in split lists
...>> a and b; i want to replace the NAs on the Value column by 2, which is >> the only numeric entry, for ID=a and by 5 for ID=b. >> >> I worked out the solution but could not replace the results in the >split lists. >> >> Original dataframe , df1 >> ID ID_2 Firist Value >> 1 a aa TRUE 2 >> 2 a ab FALSE NA >> 3 a ac FALSE NA >> 4 b aa TRUE 5 >> 5 b ab FALSE NA >> Sdf1 >> $a >> ID ID_2 Firist Value >> 1 a aa TRUE 2 >> 2 a ab FALSE NA >&g...
2018 Jan 08
2
Replace NAs in split lists
...K On Mon, Jan 8, 2018 at 3:12 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: > Upon closer examination I see that you are not using the split version of > df1 as I usually would, so here is a reproducible example: > > #---- > df1 <- read.table( text= > "ID ID_2 Firist Value > 1 a aa TRUE 2 > 2 a ab FALSE NA > 3 a ac FALSE NA > 4 b aa TRUE 5 > 5 b ab FALSE NA > ", header=TRUE, as.is=TRUE ) > > sdf <- split( df1, df1$ID ) > # note the extra [ 1 ] in case you have more than one non-NA...
2018 Jan 08
0
Replace NAs in split lists
Upon closer examination I see that you are not using the split version of df1 as I usually would, so here is a reproducible example: #---- df1 <- read.table( text= "ID ID_2 Firist Value 1 a aa TRUE 2 2 a ab FALSE NA 3 a ac FALSE NA 4 b aa TRUE 5 5 b ab FALSE NA ", header=TRUE, as.is=TRUE ) sdf <- split( df1, df1$ID ) # note the extra [ 1 ] in case you have more than one non-NA value # per ID sdf2 <- lapply( sdf...
2018 Jan 08
0
Replace NAs in split lists
...AM, Jeff Newmiller ><jdnewmil at dcn.davis.ca.us> wrote: >> Upon closer examination I see that you are not using the split >version of >> df1 as I usually would, so here is a reproducible example: >> >> #---- >> df1 <- read.table( text= >> "ID ID_2 Firist Value >> 1 a aa TRUE 2 >> 2 a ab FALSE NA >> 3 a ac FALSE NA >> 4 b aa TRUE 5 >> 5 b ab FALSE NA >> ", header=TRUE, as.is=TRUE ) >> >> sdf <- split( df1, df1$ID ) >> # note the extra [ 1 ] in...
2018 Jan 08
0
Replace NAs in split lists
...n named ID which has 2 variables > a and b; i want to replace the NAs on the Value column by 2, which is > the only numeric entry, for ID=a and by 5 for ID=b. > > I worked out the solution but could not replace the results in the split lists. > > Original dataframe , df1 > ID ID_2 Firist Value > 1 a aa TRUE 2 > 2 a ab FALSE NA > 3 a ac FALSE NA > 4 b aa TRUE 5 > 5 b ab FALSE NA > Sdf1 > $a > ID ID_2 Firist Value > 1 a aa TRUE 2 > 2 a ab FALSE NA > 3 a ac FALSE NA > $b > ID...
2018 Jan 08
1
Replace NAs in split lists
...dnewmil at dcn.davis.ca.us> wrote: >>> Upon closer examination I see that you are not using the split >>version of >>> df1 as I usually would, so here is a reproducible example: >>> >>> #---- >>> df1 <- read.table( text= >>> "ID ID_2 Firist Value >>> 1 a aa TRUE 2 >>> 2 a ab FALSE NA >>> 3 a ac FALSE NA >>> 4 b aa TRUE 5 >>> 5 b ab FALSE NA >>> ", header=TRUE, as.is=TRUE ) >>> >>> sdf <- split( df1, df1$ID ) &g...
2018 Jan 08
2
Replace NAs in split lists
Hi With the example, na.locf seems to be the easiest way. > library(zoo) > na.locf(df1) ID ID_2 Firist Value 1 a aa TRUE 2 2 a ab FALSE 2 3 a ac FALSE 2 4 b aa TRUE 5 5 b ab FALSE 5 Cheers Petr > -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jeff > Newmiller > Sent: Monday, January 8, 201...
2018 Jan 08
0
Replace NAs in split lists
...in the first record for each ID. -- Sent from my phone. Please excuse my brevity. On January 8, 2018 2:29:40 AM PST, PIKAL Petr <petr.pikal at precheza.cz> wrote: >Hi > >With the example, na.locf seems to be the easiest way. >> library(zoo) > >> na.locf(df1) > ID ID_2 Firist Value >1 a aa TRUE 2 >2 a ab FALSE 2 >3 a ac FALSE 2 >4 b aa TRUE 5 >5 b ab FALSE 5 > >Cheers >Petr > >> -----Original Message----- >> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jeff >...
2018 Jan 08
0
Replace NAs in split lists
...K On Mon, Jan 8, 2018 at 3:12 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: > Upon closer examination I see that you are not using the split version of > df1 as I usually would, so here is a reproducible example: > > #---- > df1 <- read.table( text= > "ID ID_2 Firist Value > 1? a?? aa?? TRUE???? 2 > 2? a?? ab? FALSE??? NA > 3? a?? ac? FALSE??? NA > 4? b?? aa?? TRUE???? 5 > 5? b?? ab? FALSE??? NA > ", header=TRUE, as.is=TRUE ) > > sdf <- split( df1, df1$ID ) > # note the extra [ 1 ] in case you have more than one non-NA...
2018 Jan 08
2
Replace NAs in split lists
...phone. Please excuse my brevity. > > On January 8, 2018 2:29:40 AM PST, PIKAL Petr <petr.pikal at precheza.cz> > wrote: > >Hi > > > >With the example, na.locf seems to be the easiest way. > >> library(zoo) > > > >> na.locf(df1) > > ID ID_2 Firist Value > >1 a aa TRUE 2 > >2 a ab FALSE 2 > >3 a ac FALSE 2 > >4 b aa TRUE 5 > >5 b ab FALSE 5 > > > >Cheers > >Petr > > > >> -----Original Message----- > >> From: R-help [mailto:...
2018 Jan 08
0
Replace NAs in split lists
...gt;> On January 8, 2018 2:29:40 AM PST, PIKAL Petr ><petr.pikal at precheza.cz> >> wrote: >> >Hi >> > >> >With the example, na.locf seems to be the easiest way. >> >> library(zoo) >> > >> >> na.locf(df1) >> > ID ID_2 Firist Value >> >1 a aa TRUE 2 >> >2 a ab FALSE 2 >> >3 a ac FALSE 2 >> >4 b aa TRUE 5 >> >5 b ab FALSE 5 >> > >> >Cheers >> >Petr >> > >> >> -----Original Message-...
2011 Feb 24
2
create dummy variables by for loop
HI, Dear R community, I try to create 100 dummy variables like the following: ack$id_1 <- (ack$ID==1)*1 ack$id_2 <- (ack$ID==2)*1 .. . ack$id_100 <- (ack$ID==100)*1 I used the following codes: for(i in 1:100){ ack$id_[i] <- (ack$ID==i)*1 } But only one column is created, can anyone help me? Thanks a lot! -- Sincerely, Changbin -- [[alternative HTML version...
2011 Apr 12
1
extract element from list by rownames
Hi, I've a list of list. I want to extract an element by the rownames. I can extract it by: data[[1]][[1]][[4]][1] But I want to exctract it by a command like this: data[[1]][["B0"]][["smac"]][["cont"]][1] It's possible? Thanks, Alfredo > str(data) List of 1 $ :List of 4 ..$ :List of 4 .. ..$ : num [1, 1:3] 0.4 0.458 0.5 .. ..$ : num
2006 May 08
0
Globalize howto
...#39;',''115'',''120'',''130'',''140'',''150'',''160'') default NULL, `description` text NOT NULL, `comment` text NOT NULL, `image` blob, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` USING BTREE (`id`) ) ENGINE=InnoDB; Then I used a "script/generate scaffold product" to generate a general template for my beginners application. Now the description field in the database products should be available in 3 or more languages. So I found that using Globalize would be a...
2007 Dec 10
0
password authentication stops but can be restarted
...= W3K_SERVER domain master = no local master = no preferred master = no username map = /etc/sfw/smb.users [homes] writeable = yes valid users = +sysadmin wide links = no [app] path = /var/data_path writeable = yes valid users = app_id wide links = no smb.users id_1 = DOMAINX\win_id_1 id_2 = DOMAINX\win_id_2 app_id = DOMAINX\win_id_app Note that the Windows password server is Win3K and that I have various versions of Sun supplied SAMBA. I do have some SAMBA share that use Win2K authentication and those do not seem to have this issue.
2006 Mar 28
0
Moving all items from one Scriptaculous box to another
...;h3 style="text-align:center">Selectable Items</h3> <ul class="sortabledemo" id="firstlist" style="height:200px; margin:2px; overflow:auto; border:1px solid black;"><li id="id_1">Item 1</li>;"><li id="id_2">Item 2</li> .. </ul></td> <td width="20%"><center><table> <tr><td><input type="submit" name="choose_none" value="&lt;&lt;" onClick="'' . flist = document.getElementById(...
2009 Mar 09
3
Creating an Excel file with multiple spreadsheets
...uot;,sep=""),col.names=TRUE,row.names=FALSE,sep="\t") ) How can I export DF (the original data), DF such as ID==1, DF such as ID==2,..., DF such as ID==5 to "information.xls" (just one file) naming the spreadsheets as "original", "ID_1", "ID_2",...,"ID_5", respectively? I'm running R 2.8.1 Patched on XP. Here is my sessionInfo() R version 2.8.1 Patched (2009-01-01 r47434) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERI...