similar to: [ActiveRecord::Base].collect {|a,b| ...} weirdness

Displaying 20 results from an estimated 300 matches similar to: "[ActiveRecord::Base].collect {|a,b| ...} weirdness"

2020 Aug 11
2
clarifying the handling of responses for virtio-rpmb
Hi, The specification lists a number of commands that have responses: The operation of a virtio RPMB device is driven by the requests placed on the virtqueue. The type of request can be program key (VIRTIO_RPMB_REQ_PROGRAM_KEY), get write counter (VIRTIO_RPMB_REQ_GET_WRITE_COUNTER), write (VIRTIO_RPMB_REQ_DATA_WRITE), and read (VIRTIO_RPMB_REQ_DATA_READ). A program key or write
2012 Aug 27
3
Changing entries of column of type "factor"/Adding a new level to a factor
What is a smart way to change an entry inside a column of a dataframe or matrix which is of type "factor"? Here is my script incl. input data: > #set working directory: > setwd("K:/R") > > #read in data: > input<-read.table("Exampleinput.txt", sep="\t", header=TRUE) > > #check data: > input Ind M1 M2 M3 1 1
2000 Nov 25
2
assigning to data frames with whole columns of NAs
I suppose this could be described as a feature (it seems to be similar in S-Plus), but it looks to me more like a bug. Why can't the assignment below to a row of "emptyframe" (or "anotherframe") be made? This with R --vanilla (version info below). Regards -- David David Firth Phone +44 1865 278544 Nuffield College Fax +44 1865
2005 Oct 26
1
unexpected '[<-.data.frame' result
Is this a bug? If not, I am curious to know why '[<-.data.frame' was designed to yield a.frame$y != a.frame$z rather than refusing to carry out the operation at all. > a.frame <- data.frame( x=letters[1:5] ) > a.frame[ 2:5, "y" ] <- letters[2:5] > a.frame[[ "z" ]][ 2:5 ] <- letters[2:5] > a.frame x y z 1 a b <NA> 2 b c
2009 Aug 12
1
inserting into data frame gives "invalid factor level, NAs generated"
I am calculating some values that I am inserting into a data frame. From what I have read, creating the dataframe ahead of time is more efficient, since rbind (so far the only solution I have found to appending to a data frame) is not very fast. What I am doing is the following: # create data frame goframe = data.frame(goA = character(10), goB = character(10), value = numeric(10)) goframe[1,] =
2018 Apr 18
3
How to replace numeric value in the column contains Text (Factor)?
Hi R user, Would you mind to help me on how I can change a value in a specific column and row in a big table? but the column of the table is a factor (not numeric). Here is an example. I want to change dat[4:5,3]<-"20" but it generated NA> do you have any suggestions for me? dat<-structure(list(Sites = structure(1:5, .Label = c("Site1", "Site2",
2011 Apr 12
2
Assign Character Value to Data Frame
Dear R Helpers, I am trying to write a character value to the row of a data frame and am running into a problem that I don't have when I do this for numeric arguments. For example, the following works just fine: > test<-data.frame(number=numeric(1)) > test[1,]<-.5 > test number 1 0.5 But the following bombs out: > hold<-data.frame(symbol=character(1)) >
2012 Aug 01
3
Can any one help me on this Issue
Hi Friends, I'm new to R ,I have a data frame Z16 which is genarated from another data frame, and I want to add ?%? & ?$? in row 4 and 5 respectively. when I?m trying using below logic, I?m getting warning message. I'm using R 2.14.2 Version Can anyone help me out on this. Note: Initially i used tranfrom function to do some calculations,where ever it should give zero,its
2012 Jul 26
5
Getting warning message
Hi Friends, I have a data frame X, and I want to add ?%? & ?$? in row 4 and 5 respectively. when I?m trying using below logic, I?m getting warning message. Can anyone help me out on this. X: Summary G Y R T Accts 582 644 0 1226 AcctCov 230 165 0 395 Cov% 40 26 0 32 UnCov% 60 74 0 68 EqVol11$MM8.5 10.6 0 19.1 Using this logic:
2005 Dec 14
1
[scriptaculous] scroll down to show full auto completion list (w/ possible patch)
Hi everyone, lately I''ve implemented an auto completion textfield at the bottom of a form. I was a bit bothered by the fact that the user would potentially need to scroll down in order to see all the options offered by the auto completion. I couldn''t find any information on how to auto scroll to the auto completion list with bulit-in functionality so I modified controls.js
2005 Jul 07
1
manupulating a data frame column
Could someone tell me how to fix the following error? It looks like that the reason is that df$x is of the class "factor". Thanks! > x1<-LETTERS[1:8]; x2<-letters[1:8]; x1[2]<-NA; x1[4]<-NA; > df<-data.frame(x1=x1, x2=x2) > idx<-which(is.na(df$x1)) > df[idx,1]<-df[idx,2] Warning message: invalid factor level, NAs generated in:
2006 Mar 12
1
finding warning point in function
Hi everyone, I would like to find out when and where exactly I get the following warning in a piece of code I've written: Error in "[<-"(`*tmp*`, iseq, value = numeric(0)) : nothing to replace with The code is a for () loop performing a somewhat trivial calculation, modulated by a number of logical if(){} else(){} conditions, involving the creation of a number of
2000 Sep 29
2
all.equal.list() sometimes fails with unnamed and named components (PR#674)
examples: 1) Fails to report that components 2 and 3 differ all.equal(list(1,2,3,zap=1),list(1,3,4,zap=2)) [1] "Component zap: Mean relative difference: 1 2) Incorrectly asserts all are equal when components 2 and 3 differ > all.equal(list(1,2,3,zap=1),list(1,3,4,zap=1)) [1] TRUE 3) Removing named component reveals differences: > all.equal(list(1,2,3,1),list(1,3,4,1)) [1]
2006 May 11
1
factors
Hi R-users, I had a minor issue while demonstating R that I can't explain. I am hoping someone will have suggestions. The only difference is a call to fix() in between that I made to ensure people were following me. However, that seems to have altered the way R code got executed. I was wondeirng if people have any insights. Arnab # When it does work x <-letters[1:10] marks
2011 Dec 20
5
Help with code
hello gurus, i have a data frame like this HTN HTN_FDR Dyslipidemia CAD t1d_ptype[1:25] 1 Y Y Y T1D 2 T1D 3 Ctrl_FDR 4 T1D 5 Y Ctrl 6 Ctrl 7
2008 Mar 21
5
foreign key question
Hi- Say I have a db with following schema: MyTable: Id, name, user_id, date User: id, name, description I know that I want to add "belongs_to" in my "user" model but how can I enforce a proper constraint on the user_id in "MyTable"? Is this done using a has_one in the "MyTable" model? Thanks! --~--~---------~--~----~------------~-------~--~----~ You
2018 Apr 18
0
How to replace numeric value in the column contains Text (Factor)?
The simplest would be to convert precip to character and then back to a factor if you really want it to be a factor. This will also remove the levels that no longer exist. str(dat) # 'data.frame': 5 obs. of 3 variables: # $ Sites : Factor w/ 5 levels "Site1","Site2",..: 1 2 3 4 5 # $ temp : num 14 15 12 12.5 17 # $ precip: Factor w/ 5 levels
2005 Jun 23
1
Stop Warnings for Invalid Factor Level, NAs generated?
How can I stop the following warning from occuring? invalid factor level, NAs generated in: "[<-.factor"(`*tmp*`, iseq, value = structure(1, .Label = "12", class = "factor")) The Label messages are for "5", "8", "12" and "46". I want the NAs to be generated as needed. Is this causing R to slow down by generating the warning
2009 Jul 25
1
a question about replacing a column that is factor
Hi, everyone, I want to use a new value to replace a column that is a factor. However this column is replaced by <NA> , which is not what I want. I know this is because the new value is not in the levels of that column, but I don't know how to fix it. Can someone help me to figure this out? The following is what I did thanks jlm >
2002 Aug 22
1
RXLisp
I was obviously fascinated by Duncan's earlier message on RXLisp. I managed to build a working version of RXLisp for OS X, by some unabashed and rather uninformed hacking. I compiled XLISP-STAT using the gcc flags -fno-common and --no-cpp-precomp (not sure if they are necessary or not, they are part of an older hack). I "make libxlisp.so", using Duncan's replacement for the