Displaying 20 results from an estimated 1000 matches similar to: "columns mapping"
2011 Jul 21
1
nested loop for
Hi everyone,
I have been working some days in a nested loop in R but I can't find the solution.
I have a data.frame with an unique ID for individuals and unique ID for different stands, for each indiviadual I have a dbh record and a SBA (stand basal area) field.
Pma<-rep (1:40)
P<-seq(1,4, 1)
Plot<-rep(P,10)
dbh2<-rnorm(40, mean=200, sd=5)
SBA2<-rnorm(40, mean=10, sd=1)
As
2013 Dec 06
2
Using assign with mapply
I have a data frame whose first colum contains the names of the variables
and whose second colum contains the values to assign to them:
: kkk <- data.frame(vars=c("var1", "var2", "var3"),
vals=c(10, 20, 30), stringsAsFactors=F)
If I do
: assign(kkk$vars[1], kkk$vals[1])
it works
: var1
[1] 10
However, if I try with mapply
2010 Feb 07
2
conditioned xyplot, many y variables
The example below creates parallel time-series plots of three different y variables conditioned by a dichotomous factor. In the graphical layout,
? Each y variable inhabits its own row and is plotted on its own distinct scale.
? Each level of the factor has its own column, but within each row the scale is held constant across columns.
? The panels fit tightly (as they do
2007 Feb 23
4
using "integrate" in a function definition
Dear list members,
I'm quite new to R, and though I tried to find the answer to my probably
very basic question through the available resources (website, mailing
list archives, docs, google), I've not found it.
If I try to use the "integrate" function from within my own functions,
my functions seem to misbehave in some contexts. The following example
is a bit silly, but
2015 Jan 29
0
[Q] Get formal arguments of my implemented S4 method
I wouldn't want to add more to the current approach; if someone would like to devote some time, the much preferable idea IMO would be to replace the whole mechanism.
Here's one suggestion:
1. have a class, say "nonConformingMethod" for method definitions that diverge in the argument list.
2. the internal dispatch code checks the class of the selected definition (this can
2015 Jan 29
1
[Q] Get formal arguments of my implemented S4 method
Would we really need the special class or would simply checking the formals
of the method against those of the generic be simple and fast enough?
On Thu, Jan 29, 2015 at 9:41 AM, John Chambers <jmc at r-project.org> wrote:
> I wouldn't want to add more to the current approach; if someone would like
> to devote some time, the much preferable idea IMO would be to replace the
>
2015 Jan 29
2
[Q] Get formal arguments of my implemented S4 method
I wish it didn't have to depend on the name '.local'.
Back when I wrote a lot of S4 methods I avoided the auto-generated .local
and named the local function something that made sense so that is was easier
for a user to track down the source of an error.
E.g., define the generic QQQ with numeric and integer methods:
setGeneric("QQQ",
function(x, ...)NULL)
2013 Feb 16
1
[LLVMdev] A weird problem when try to output operand of instruction involving function pointer in a struct
Hi all,
I just start to learn llvm. I am trying to get the operand's name of some
instruction that invokes a function field of a struct. While, I found in
the result that there is a sequence number attached to the function field
name. Below is an example:
/******source code t2.c*******/
#include <stdio.h>
void F(){printf("F\n");}
void E(){printf("E\n");}
void
2009 Oct 21
1
formula and model.frame
Suppose I have the following function
myFun <- function(formula, data){
f <- formula(formula)
dat <- model.frame(f, data)
dat
}
Applying it with this sample data yields a new dataframe:
qqq <- data.frame(grade = c(3, NA, 3,4,5,5,4,3), score = rnorm(8), idVar = c(1:8))
dat <- myFun(score ~ grade, qqq)
However, what I would like is for the resulting dataframe (dat) to include
2011 Apr 09
1
How do I make this faster?
I was on vacation the last week and wrote some code to run a 500-day
correlation between the Nasdaq tracking stock (QQQ) and 191 currency pairs
for 500 days. The initial run took 9 hours(!) and I'd like to make it
faster. So, I'm including my code below, in hopes that somebody will be able
to figure out how to make it faster, either through parallelisation, or by
making changes. I've
2010 Jul 08
5
No space left on device on not full filesystem
Hello,
We have running lustre 1.8.1 and have met "No space lest on device"
error when uploading 500 Gb small files (less then 100 Kb each).
The problem seems to depends on the number of files. If we remove one
file, we can create one new file, even with Gb size; but if we haven''t
remove something we can''t create even very little file, as an example
using touch
2009 Jul 04
2
[LLVMdev] Alloca Instruction
Hi all,
I was reading the description of run-time stack and alloca instructions in
LLVM IR and have a question about the same. Do LLVM alloca instructions
allow the processing on stack across some alloca blocks?
For example, is following code valid?
define i32 @f()
{
%0 = alloca i8, i32 16
%1 = ptrtoint i8* %0 to i32
%2 = add i32 %1, 4
%3 = inttoptr i32 %2 to i32*
2009 Jun 23
2
Long to wide format without time variable
Hi all,
I am trying to convert a data set of physician death codings (each individual's cause of death is coded by multiple physicians) from long to wide format, but the "reshape" function doesn't seem to work because it requires a "time" variable to identify the sequence among the repeated observations within individuals. My data set has no order, and different
2010 Jul 23
3
Filtering in R
The dataframe is
id salary
100 500
101 600
102 700
103 800
how can i generate a subsets if salary>600?
--
View this message in context: http://r.789695.n4.nabble.com/Filtering-in-R-tp2299603p2299603.html
Sent from the R help mailing list archive at Nabble.com.
2009 Nov 13
6
replace a whole word with sub()
Dear all,
I cannot figure out how to solve a small problem (well, not for me), surely somebody can help me in few seconds.
I have a series of strings in a vector X of the type "xxx", "yyy", "zzz", "IgA", "IgG", "kkk", "IgM", "aaa".
I want to substitute every ENTIRE string beginning with "Ig" with
2010 Jul 22
1
How do I get rid of list elements where the value is NULL before applying rbind?
Here is the function that makes the data.frames in the list:
funweek <- function(df)
if (length(df$elapsed_time) > 5) {
res = fitdist(df$elapsed_time,"exp")
year = df$sale_year[1]
sample = df$sale_week[1]
mid = df$m_id[1]
estimate = res$estimate
sd = res$sd
samplesize = res$n
loglik = res$loglik
aic = res$aic
bic = res$bic
chisq =
2010 Jul 06
3
how to define a function in R
1. how to write a R script?
2.How to write a SAS like macro/generic process to process multiple files by
using the same funstion in R?
Thanks in advance
--
View this message in context: http://r.789695.n4.nabble.com/how-to-define-a-function-in-R-tp2280290p2280290.html
Sent from the R help mailing list archive at Nabble.com.
2002 Aug 01
1
Connection refused
I'm sure this has been asked a zillion times so I searched for hours before
posting this. How can there be so little documentation on this.
Point me to what to read.
rsh is good:
[g3p:~] smith% rsh -l a1012 sv1.domain.com
Password:
{a1012@sv1.domain.com:65}
rsync not good:
[g3p:~] smith% rsync -av a1012@sv1.domain.com:kkk.txt sync/
rsync: open connection using rsh -l a1012 sv1.domain.com
2010 Jul 12
2
cbind in for loops
I have 30 files in the current directories, i would like to perform the
cbind(fil1,file2,file3,file4....file30)
how could i do this in a for loop:
such as:
file2 <- list.files(pattern=".out3$")
for (j in file2) {
cbind(j).......how to implement cbind here
}
Thanks.
--
View this message in context:
2010 Nov 26
3
Calling substitute(expr, list(a=1)) when expr <- expression(a+b+c)
# The result I am after is the result after a substitution in an expression, such as
substitute(expression(a+b+c), list(a=1))
expression(1 + b + c)
# However, the way I want to do it is for a an expression "stored as a variable" as
(expr <- expression(a+b+c))
expression(a + b + c)
# a) The following does not work
(expr2 <- substitute(expr, list(a=1)))
expr
# b) - whereas this