Displaying 20 results from an estimated 1000 matches similar to: "Use a text variable's value to specify another varaible?"
2008 Mar 25
2
Incorrect behavior in 64-bit version (PR#11034)
Full_Name: Lodewijk Bonebakker
Version: v2.6.2
OS: Solaris, x86, snv_80
Submission from: (NULL) (192.18.43.225)
when I build R in 32-bit mode on my 64-bit OS, R works as expected:
R version 2.6.2 (2008-02-08)
...
Type 'q()' to quit R.
> m <- matrix(ncol=2,c(1:6))
>
> m
[,1] [,2]
[1,] 1 4
[2,] 2 5
[3,] 3 6
> n <- log10(m)
> n
[,1]
2013 Jan 28
1
gigFit problems
Hi, I am having some problems with gigFit and would like confirmation on
other platforms; mine is mint; basically Debian.
Although I got a good fit for the density function with the GIG equation
in another curve fitting program, I would really like to use R's tools
for confidence intervals and manipulations; but the problems below make
me uneasy.
Problem one (from examples with parameter
2013 Jul 25
1
GGplot 2 – cannot get histogram and box plot axis to match.
Problem:
I am trying to get the histogram and box plot x axis to match. I?ve tried using the expand_limits function to make the axis match but that didn?t make the axis match. The histogram?s axis are still consistently larger than the ones for the box plot (though the function did help). Does anyone have a suggestion as to what I should do instead?
Background:
I am building a Shiny app that
2004 Apr 08
1
Why are Split and Tapply so slow with named vectors, why is a for loop faster than mapply
First, here's the problem I'm working on so you understand the context. I
have a data frame of travel activity characteristics with 70,000+ records.
These activities are identified by unique chain numbers. (Activities are
part of trip chains.) There are 17,500 chains.
I use the chain numbers as factors to split various data fields into lists
of chain characteristics with each element of
2009 Jul 02
1
Quantitative Risk Management by McNeil
Dear Specialists in R,
May be somebody has experiment in using pakage for the book Quantitative
Risk Management by McNeil?
This package is writen in R.
I have run this package for fitting the data to Nornal Inverse Gaussian
distribution and fased with following problem.
> Return<-read.csv("data.csv")
> Transpose<-t(Return)
> fit.NH(Transpose, case="NIG",
2008 Mar 17
8
Table of basic descriptive statistics like SPSS
Dear list readers,
I want to:
1. Get a table of basic descriptive statistics for my variables
with the variable names one below the other
like SPSS descriptive statistics:
Varname N Min Max Mean SD
xxxx x x x x x
xxx x x x x x
....
2. Delete some variables from a data frame or exclude variables
from beeing analyzed.
3. Create a text file / redirect the terminal output to a
2012 Nov 21
5
Creating a frequency table for binomial varaible
Hello,
I have simulated 30 observations from a binomial(5,0.1) distribution.
Now I need to make frequency table( that means I need to tally how many 0's
, 1's 2's....... 5's)
I know that the simple R function table() will do this, but I am afraid
that some times I may get zero frequency for some particular values (for
example in the above there are 5-0's 10-1's ,
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
2011 Jan 25
2
barplot with varaible-width bars
I would like to produce a bar plot with varying-width bars. Here is an example to illustrate:
ww <- c(417,153,0.0216,0.0065,556,256,0.0162,0.0117,
+ 726,379,0.0358,0.0501,786,502,0.0496,0.0837,
+ 892,591,0.0785,0.0795)
yy<-t(t(array(ww,c(2,10))))
barplot(yy[,2*1:5],las=1,space=c(.1,.5),beside=T)
produces a barplot of 5 pairs of bars that are of equal width
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
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
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 <-
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 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 Feb 09
1
How to add the variable name to a qqplot or densityplot in the diagonal of an splom?
splom() doesn't complain here, but writes no names in the diagonal
boxes. What am I missing?
I believe that I need to add something like grid.text(x, ...) to the
diagonal panel, but I don't know how to get it cycle through the
column labels. And should
varname.col = 'blue', varname.cex = 1
be inside the diag.panel() function?
splom(szw[, n], pscales = 0,
diag.panel
1999 Sep 29
1
getenv() can't differentiate "defined but empty" and "undefined"
getenv(<varname>) currently returns ""
if the <varname> is undefined.
However, if <varname> is defined but empty,
getenv(<varname>) still only returns "".
I think this is quite unfortunate
but consistent with the prototype.
---
I'd propose to change the current behavior.
Something which should be pretty back compatible would
for the first
2010 Dec 16
1
my function does not work for large data set
Dear R community,
I have one function, it works for small data set, but does not work on large
data set, can anyone help me with this?
> #creat new variable by dividing each aa dimer by total_length.
> imper<-function(x, file) {
+ round(x/file$length, 5)
+ }
> dim(test)
[1] 999 2402
> test[varname[2:2401]]<-
2011 Apr 27
1
Eval to write many files
Dear all
I am looking for a shorter way and more elegant to write the following
for (i in c(1:length(Shadowlist))){
filename<-paste('/home/apa/maps/',model,i,'.mat',sep="")
varname<-paste(model,'_shadow',i,sep="")
eval(parse(text=paste('writeMat(filename,',varname,'=Shadowlist[[i]])',sep="")))
}
actually I do not
2005 Nov 23
1
assign() problem
I've written a piece of code (see below) to do a wavelet image
decomposition, during the evaluation of this code I would like to write
the results of some calculations back to the R root directory. I used
assign() to do so because the names should vary when going thrue a
while() loop. For some unknown reason I get an error that says:
Error in assign(varname[i], imwrImage) :
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