Displaying 20 results from an estimated 500 matches similar to: "R: "in-place" appending to a matrix."
2018 Jun 25
2
How to include a opt pass in clang driver
Hello,
I have written a pass for the IR and I can run it with opt -load
lib/LLVMMyPass.so -mypass -myarguments -S -o output.ll < output.bc
I have registered my pass with the following code:
static RegisterPass<MyPass>
X("mypass", "MyPass Pass (with getAnalysisUsage implemented)");
How do I include the same pass in the clang driver. I tried running the
pass:
clang
2011 Nov 23
1
Losing custom attributes
Hi All,
I was adding a new row of data to my data frame using rbind(). I
was surprised to see that after adding new row, I lost my data frame level
attibute as well as col level attribute. Please help me to insert a new
row at frist or middle position so that my custom attribute is not lost.
Here is what I did.
age<-c(15,20,18)
weight<-c(40,42,30)
### creating my data frame
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 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
2008 Oct 21
1
Paddding an integer with zeros
Hello List,
Can anybody point me to a number-to-string formatting function?
I need to convert, say, 12 to 00012.
I tried format() but its too stubborn: it seems to only pad with spaces.
Thank you,
Your culpritNr1
--
View this message in context: http://www.nabble.com/Paddding-an-integer-with-zeros-tp20095300p20095300.html
Sent from the R help mailing list archive at Nabble.com.
2018 Jun 25
2
How to include a opt pass in clang driver
Hi Eli,
I have tried that:
static void registerMyPass(const PassManagerBuilder &,
llvm::legacy::PassManagerBase &PM) {
PM.add(new MyPass());
}
static RegisterStandardPasses
RegisterMyPass(PassManagerBuilder::EP_OptimizerLast,
registerMyPass);
It still couldn't find my pass.
Regards,
Soham Sinha
PhD Student,
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
2008 Oct 21
2
Inserting a new row in a matrix
Hi guys,
I need to insert a row to a matrix in a for loop. I have matrix named "Avg"
which is a 5x4 matrix of zeros.
I have a file named "A"(4 rows,14 columns) which I make a sample of it 5
times. each time I get the mean for each column and put the result in the
"Avg" matrix. this is my code:
Avg=matrix(0,5,4)
>
> for(i in 1:5){
+ res=(A[sample(nrow(A),
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
2009 May 21
2
subsetting of a data.frame
Hello everybody
How do you subset a data.frame when your boundaries are a combination of
explicit and implicit limits?
For example, I need to subset from the fourth (explicit) to the last
(implicit) column a data.frame named A.
In other languages you would do A[ , 4:]. Would anybody show me the R's way?
Thank you,
Your culprit
--
View this message in context:
2009 Jan 06
2
Drawing from an empirical distribution
Hi All,
Does anybody know if there is a simple way to draw numbers from an empirical
distribution?
I know that I can plot the empirical cumulative distribution function this
easy:
plot(ecdf(x))
Now I want to pick a number between 0 and 1 and go back to domain of x.
Sounds simple to me.
Any suggestion?
Thank you,
Your culprit
(everybody needs a culprit)
--
View this message in context:
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