similar to: Losing custom attributes

Displaying 20 results from an estimated 300 matches similar to: "Losing custom attributes"

2011 Nov 23
2
SPSS F-test on change in R square between hierarchical models
Hi, I am wondering if anyone knows how to perform an F-test on the change in R square between hierarchical models in R? SPSS provides this information and a researcher that I am working with is interested in getting this information. Alternatively, if someone knows how I can calculate the test statistic (SPSS calls it F-change?) and dfs that would be helpful as well. The output and the test I am
2002 Nov 13
2
Importing with read.table
Hi all. I have something similar to the following: myinfo <- read.table( file = "myfile.txt", sep = "|", col.name = c( "data1", "data2" ) ) myfile.txt: a|1| b|2| However, since there are two pipe (|) characters, it reads it in and thinks there should be three columns. This is not the case and I get a warning about col.names is wrong length. Is there a
2008 Oct 15
2
R: "in-place" appending to a matrix.
Hello fellow R sufferers, Is there a way to perform an appending operation in place? Currently, the way my pseudo-code goes is like this for (i in 1:1000) { if (some condition) { newRow <- myFunction(myArguments) X <- rbind(X, newRow) # <- this is the bottleneck!! } } As you can see, it works but as the matrix X gets the size of a few million rows, the
2011 Nov 24
3
Is there way to add a new row to a data frame in a specific location
Is there easy way (without copying the existing rows to a temporary location and copying back) to add a new row to a specific index location in an existing data frame? Example df = data.frame( A= c('a','b','c'), B=c(1,2,3), C=(10,20,30)) newrow = c('X', 100, 200) I want to add the newrow as the second row to the data frame df Please suggest a solution that is
2011 Apr 28
1
Trying to perform an inner loop a random number of times
Grateful for any hints as to why I'm not getting the inner loop to cycle the expected number of times. Code and one run's results below. Thanks, Galen > # source("looptest.r") > sp<-numeric() > iter<-numeric() > rn<-numeric() > ds<-data.frame(sp, iter, rn) > > for (sp in c(1:6)) { + i<-1 +
2006 May 12
7
RJS and page.select collection size
I need to implement a conditional in my RJS template which looks something like: if (page.select(''row1'').first != null) page << "new TableRow.MoveAfter(''row1'', ''newrow'');" else page << "new TableRow.MoveAfter(''row2'', ''newrow'');" end Now, dumb question.. My
2011 Oct 29
1
Add col in data.frame
Hello Gurus, I am still new to R. Here is my issue. I was trying to add column to data frame that was populated by read.spss(). When I used cbind to add a new variable(column). library(foreign) mydf<-read.spss(file="C:/myspss.sav",use.value.labels=FALSE, to.data.frame=TRUE,use.missings=FALSE) attr(mydf,"variable.labels") ## it gives you all the labels
2010 Aug 13
1
loop for inserting rows in a matrix
Dear R friends, I have a matrix with 2060 rows and 41 columns. One column is Date, another is Transect, and another is Segment. I want to ensure that there are 9 Transects (1 to 9) for each Date, and 8 Segments (1 to 8) for each Transect in the matrix, by inserting rows where these are missing. I am new to coding, but am trying to write a loop which checks if each of the transects already
2011 Apr 25
1
Trouble Passing a for loop variable (iteration #) to a data frame
Greetings - I am working on a piece of code to simulate vehicle times in and out in each of a number of parking spaces. At this stage, my code basically does what it is supposed to do but for the sequential number of each new parking event for a given space (i.e., the index of the loop variable). Instead of passing the index of the loop variable (iter) to the data frame, it passes the value
2011 Nov 12
1
With an example - Re: rbind.data.frame drops attributes for factor variables
When I use rbind() or rbind.data.frame() to add a row to an existing dataframe, it appears that attributes for the column of type "factor" are dropped. See the sample example below to reproduce the problem. Please suggest How I can fix this. Thanks, Sammy a=c("Male", "Male", "Female", "Male") b=c(1,2,3,4) c=c("great", "bad",
2004 Jul 29
3
Editing Strings in R
I was wondering if there is a way of editting strings in R. I have a set of strings and each set is a row of numbers and paranthesis. For example the first row is: (0 2)(3 4)(7 9)(5 9)(1 5) and I have a thousand or so such rows. I was wondering how I could get the corresponding string obtained by adding 1 to all the numbers in the string above. Dursun [[alternative HTML version deleted]]
2007 May 15
1
Effect.dropout and Too Much Recursion Error
Hi, I need some help again. :-) I have "Too much recursion error" prototype.js line 1288, I heve this error when I try to use Effect.dropout (script.aculo.us) if I remove table ID, there is no error, and the effect works fine (remove the tr from table) But I need this ID assign to this table, as table ID is used by other effect (Builder.node) Please help .... Thanks YUAN Here is
2010 Feb 06
1
duplicating records
Dear friends, I need to fill in (duplicate the whole record) the missing days with the same record values as long as AE is the same value (i.e. "1"), once AE value changes, the process of duplication should proceed with the new AE value till it changes again. e.g. I need to fill in records: day 18-day 44, all the records are carried with the new AE value of "0". At the
2005 Sep 27
8
prototype.js
Hi *, We don''t know if you guys are the right audience, but we got a problem with prototype.js we need to solve. Essentially, it is a compatibility bug with the IE. We wrote a component so it updates itself periodically using AJAX. we used the prototype.js to accomplish this (using the periodicalUpdater object). now the component works fine using firefox or opera, but NOT with IE. the
2010 May 14
2
Subscripting a matrix-like object
I have an S3 class called "tis" (Time Indexed Series) which may or may not have multiple columns. I have a function "[<-.tis" that I've reproduced below. My question is this: inside of "[<-.tis", how can I distinguish between calls of the form x[i] <- someValue and x[i,] <- someValue ? In either case, nargs() is 3, and looking at the values
2010 May 14
2
Subscripting a matrix-like object
I have an S3 class called "tis" (Time Indexed Series) which may or may not have multiple columns. I have a function "[<-.tis" that I've reproduced below. My question is this: inside of "[<-.tis", how can I distinguish between calls of the form x[i] <- someValue and x[i,] <- someValue ? In either case, nargs() is 3, and looking at the values
2010 Mar 18
2
Pedigree / Identifying Immediate Family of Index Animal
I have a data frame containing the Id, Mother, Father and Sex from about 10,000 animals in our colony. I am interested in graphing simple family trees for a given subject or small number of subjects. The basic idea is: start with data frame from entire colony and list of index animals. I need to identify all immediate relatives of these index animals and plot the pedigree for them. We're
2007 Mar 04
0
Event listeners
Hello.. I am playing around on a pilot project with this wonderful Rails plugin.... thanks for sharing it w us ! I read in a post , in reply to this subject yjat : Events are possible. Either through the @map.record_init "azeazeae" (for arbitrary events like domlistener) or through the @map.event_init(@map,:click,"function(){alert(''HOYOYO'');}"). The
2017 Aug 23
0
splitting a dataframe in R based on multiple gene names in a specific column
Hi Bogdan, Messy, and very specific to your problem: df.sample.gene<-read.table( text="Chr Start End Ref Alt Func.refGene Gene.refGene 284 chr2 16080996 16080996 C T ncRNA_exonic GACAT3 448 chr2 113979920 113979920 C T ncRNA_exonic LINC01191,LOC100499194 465 chr2 131279347 131279347 C G ncRNA_exonic LOC440910 525 chr2 223777758 223777758 T A
2017 Aug 25
1
splitting a dataframe in R based on multiple gene names in a specific column
If row numbers can be dispensed with, then tidyr makes this easy with the unnest function: ##### library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union library(purrr)