Displaying 20 results from an estimated 454 matches for "varnaming".
Did you mean:
variating
2008 Oct 12
1
Conditionally skip over "for(..){" and "}"??
Hi Folks,
I'm wondering if there's a secret trick to achieve the following.
I have some big code for analysis related to a named variable,
which will be one of several in the columns of a dataframe, and
I would like to be able to choose between a run for just one of
these variables, or a run which loops over them all.
So, for a single run, I could have the following kind of thing
in a
2006 Jul 13
1
writeForeignSAS and potential extensions
Dear R-devel,
I've made some potential extensions to writeForeignSAS
in 'foreign' that I wanted to pass along if anyone is
interested. I've attached the diff -u output against
the version found in foreign_0.8-15 and an .R file
with my changes. (In this .R file, the function is named
writeForeignSAS7 to simplify testing/comparisons.)
I've tried to alter the current
2010 Feb 11
4
Access variables by string
Dear all,
I have two probably very easy questions:
(1) Is there a way to access certain variables by their string-based
name representation?
Example:
numbers <- c("one", "two", "three")
varname <- "numbers"
print(varname[2])
(2) I need this functionality for a customized na.exclude() function
that I am building, which should only exclude rows
2007 Jan 26
2
Use a text variable's value to specify another varaible?
Greetings guRus --
If a variable, e.g., 'varname', is a character string, e.g. varname <-
"datavector", and I want to apply a function, such as table(), to
datavector, what syntax or method will do so using only the variable
varname? This seems similar to indirect addressing, but I have not seen
a method for it in the R manuals. Is there a general name for such
indirect
2003 May 31
5
parse on left hand side of R assignment
I keep finding myself in a situation where I want to calculate a
variable name and then use it on the left hand side of an assignment.
For example
iteration <- 1
varName <- paste("run",iteration,sep="")
myList$parse(text=varName) <- aColumn
I want to take some existing variable "aColumn" and use the name
"varName" name for it and put it into a
2003 Nov 10
3
Reading an upper triangular matrix
Hola!
I have data in the form of a symmetric distance matrix, in the file I
have recorded only the upper triangular part, with diagonal. The
matrix is 21x21, and the file have row and col names, and some other
information. I am trying to read with the following code (I tried
many variations on it, but all give the same error). The items in the
data file is delimited by white space.
(Part
2017 Aug 13
1
ggplot's aes_ doesn't work as expected for x=factor()
I'm learning how to use ggplot in a programming approach where I supply variable names on the fly. Using aes_ doesn't work as I expected when x = factor(x). Is this a bug or am I not understanding something?
# toy dataset
df <- data.frame(LogicalVar = c(FALSE, TRUE, FALSE, TRUE, FALSE, TRUE),
Var1 = c(0.01, 0.01, 1, 1, 30, 30),
pct1 = c(12, 88, 60,
2010 Jun 28
1
mathematical expression in varnames of lattice parallel plot
How can I insert mathematical expressions for variable names in a
lattice parallel plot? I tried to implement mathematical expressions in
varnames, however, without success.
For example, neither
parallel(~iris[1:4] | Species, iris,
varnames=c("P[Width]", "Petal[length]", "alpha[Width]", "Sepal[Length]"))
nor
parallel(~iris[1:4] | Species,
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
Hi Justin,
my class is a visitor pattern and I use accept method to go recursive in
suboject in my AST.
In locals I store AllocaInst pointer.
void *visit(var1_init_decl_c *symbol) {
llvm::Type *lType;
varNames.clear();
varType = "";
symbol->var1_list->accept(*this); /* get a vector contains variable names */
symbol->spec_init->accept(*this); /* Store in
2011 Jun 17
1
is this a bug?
Hello,
Is the following a bug? I always thought that df$varname <- does the same as
df["varname"] <-
> df <- data.frame(weight=round(runif(10, 10, 100)), sex=round(runif(100, 0,
1)))
> df$pct <- df["weight"] / ave(df["weight"], df["sex"], FUN=sum)*100
> names(df)
[1] "weight" "sex" "pct" ###
2010 Aug 11
2
assignment functions with inherited class error
# Two test for a class like this:
setClass("XXX",
representation=representation(
"matrix"
)
)
i<-new("XXX");
m=matrix();
colnames(m)<-c("colA");
i at .Data=m;
# >i
# An object of class ?XXX?
# colA
#[1,] NA
#________________________________________________________________________
#First Test
"varnames<-" <- function(x,value){
2009 Oct 02
3
help with regexp mass substitution
Hello *
i have to rename a lot of variables, and, given that they have regular name constructs, I would like to use regexps.
Here's a dump of my head(names(df))
varnames <- c("id.quest", "txt.1.3", "col1.1.3", "col2.1.3", "col3.1.3",
"col4.1.3", "col5.1.3", "txt.2.3", "col1.2.3",
2006 Jul 13
2
simple question about variables....
Dear R users,
I have a simple question on variable manipulation.
Imagine I have an object "OBJ" that has "toto" as one of its variables.
I would like to understand why if I do
> varname <- "toto"
>OBJ$varname returns no results
whereas
> OBJ[varname] returns the column entitled
2006 Sep 15
1
Formula aruguments with NLS and model.frame()
I could use some help understanding how nls parses the formula argument
to a model.frame and estimates the model. I am trying to utilize the
functionality of the nls formula argument to modify garchFit() to handle
other variables in the mean equation besides just an arma(u,v)
specification.
My nonlinear model is
y<-nls(t~a*sin(w*2*pi/365*id+p)+b*id+int,data=t1,
2012 Jul 14
2
Loading in Large Dataset + variables via loop
Hello, I'm new to R with a (probably elementary) question.
Suppose I have a dataset called /A/ with /n/ locations, and each location
contains within it 3 time series of different variables (all of 100 years
length); each time series is of a weather variable (for each location there
is a temperature, precipitation, and pressure). For instance, location 1
has a temperature1 time series, a
2012 Jun 22
3
dropping variables from a data frame inside a function
Why doesn't this work?
#Drop a variable name from a data frame
DropLikeSAS <- function(x,df) {
df[[x]] <- NULL
0
}
DropLikeSAS("VarName", DataFrameName)
Try it. The column VarName will not be deleted from the data frame DataFrameName.
But
x <-
2007 Oct 16
1
Adding axis lines to splom plots
Hi,
I am trying to produce a 30x30 lattice grid. The 30 variables naturally
fall into three groups of ten and I would like to add thicker axis lines
around these to highlight this. However, I can only do this separately,
so far, and I don't know how to superimpose the grid with the thicker
lines (separating the 10x10 groups) onto the overall grid of all 30x30
plots. I enclose a
2013 Jan 11
0
[LLVMdev] Make a comparation with IR builder
On Fri, Jan 11, 2013 at 8:20 AM, Manuele Conti
<manuele.conti at sirius-es.it>wrote:
> Hi Justin,
> my class is a visitor pattern and I use accept method to go recursive in
> suboject in my AST.
> In locals I store AllocaInst pointer.
>
>
> void *visit(var1_init_decl_c *symbol) {
> llvm::Type *lType;
>
> varNames.clear();
> varType = "";
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
Hi All,
I'm writing a code generation with my compiler. I read sever example and
documentation but I did understand what I make wrong.
What I try to do is a compare a local variable with a constant.
But when I create a ICMP instruction I get that instruction are not of
same type.
I'm using llvm by svn repository updated at two week ago.
The code that I try to generation is something
2006 Feb 12
1
lme, nlsList, nlsList.selfStart
Dear listers,
I am trying to fit a model using nlsList() using alternately a SSfol()
selfstart function or its developped equivalent formulae.
This preliminary trial works well
mydata<-groupedData(Conc~Tps|Organ,data=mydata)
mymod1<-nls(Conc~SSfol(Dose,Tps,lKe,lKa,lCl),data=mydata)
as well as a developped form:
mymod2<-nls(Conc~Dose * exp(lKe+lKa-lCl) *