similar to: create a vector looping over a frame

Displaying 20 results from an estimated 100 matches similar to: "create a vector looping over a frame"

2004 Feb 06
2
vector of factors to POSIXlt
hello, I have a vector of factors > str(rcptdt) Factor w/ 51 levels "1/10/03","1/13/03",..: > length(rcptdt) [1] 87 which i want to convert to class POSIXlt to extract the day, so: a1<-format(rcptdt,"%m/%d/%y") > length(a1) [1] 87 and: a2<-strptime(a1, "%m/%d/%y") str(a2) `POSIXlt', format: chr [1:87] "2002-04-18"
2004 Nov 02
2
using R in .NET apps
looking for some thoughts on incorporating R functionality to create histograms of data stored in an informix db. im gonna write the app in .Net and will use a managed provider to access the data. what R libs might I have to package in the assemblies? (sorry my Q is general as Ive only just looked at wanting this yet) Thanks. Amer.
2012 Jun 10
3
Data.frames can not hold objects...What can be done in the following scenario?
R-Help community, I understand that data.frames can hold elements of type double, string etc but NOT objects (such as a matrix etc). This is not convenient for me in the following situation. I have a function that takes 2 inputs and returns a vector: testfun <- function (x,y) seq(x,y,1) I have a data.frame defined as follows: testframe<-data.frame(xvalues=c(2,3),yvalues=c(4,5)) I would
2012 Jun 15
0
argument "x" is missing, with no default - Please help find argument x
R programming question, not machine learning, although that's the content. Apologies to all for whom the following code is eye-burning. I am using foreach() to run a simulation on a randomForest model (actually conditional randomForest ... "party" package). The simulation is in two dimensions. examining how "mtry" and "ntrees" are related in terms of predictive
2005 Mar 29
2
strange error with rw2010dev
With rw2010dev I get a strange protect(): protection stack overflow error with a small data frame which otherwise is usable: If anybody wants to have a look I can provide an RData file with the problematic data frame. Doesn't seem to be necessary, the following simulated example generates the error: > testmat <- matrix(1:80, 20,4) > dim(testmat) [1] 20 4 > str(testmat) int
2014 Aug 02
2
[LLVMdev] Create "appending" section that can be partially dead stripped
On 01/08/14 19:37, Reid Kleckner wrote: > What happens if you drop appending linkage? I think it will just work, > since you are already using a custom section, which will ensure that all > the data appears contiguously in memory. Thanks for the suggestion, but it still puts everything in a single .section statement. > Although, I do worry about what LLVM's alias analysis will
2014 Aug 05
2
[LLVMdev] Create "appending" section that can be partially dead stripped
On 04 Aug 2014, at 09:27, Reid Kleckner wrote: > On Sat, Aug 2, 2014 at 7:51 AM, Jonas Maebe > <jonas.maebe at elis.ugent.be> > wrote: > >> On 01/08/14 19:37, Reid Kleckner wrote: >> >>> What happens if you drop appending linkage? I think it will just >>> work, >>> since you are already using a custom section, which will ensure
2012 Jun 09
1
Applying a function to a column of a data frame
Apologees the novice question. Currently climbing up the learning curve of R. Suppose I have the following function and the data.frame: testfun<-function(x=1,y=2) x+y testframe=data.frame(col1=c(1,2),col2=c(3,4)) When evaluating testfun, I want to use the default value for y (which is 2) and for x, I want to feed (one by one) the values in col2 of testframe. How can I achieve this please?
2011 May 23
1
Applying boxplot.stats to multiple value lists
Hello all R gurus, I have a following problem which I hope someone will help me to solve. I have a data.frame in form similar to below. > testframe<-data.frame("Name"=c("aa","aa","aa","aa","aa","bb","bb","bb","bb","bb"),"Value"=c(1,100,1,1,1,100,100,100,100,1))
2003 Nov 07
1
barplot(names.arg) versus axis(labels)
Should I be able to use axis() on a barplot? i have a data.frame, the first 3 values of which are: > c[1:3,] median mean A1 56.5 58.50000 A61 73.0 73.00000 A62 63.0 63.00000 > str(c) `data.frame': 19 obs. of 2 variables: $ median: num 56.5 73 63 161 51 55 44.5 22 54 49 ... $ mean : num 58.5 73.0 63.0 161.0 47.5 ... if I do barplot(median) and then try
2009 Apr 28
1
[macosx] improving quartz & Aqua Tk behaviour outside of RGui
Hello, On Mac OS X, certain Aqua/Quartz UI functionality requires an application to be launched from within an app bundle, or (alternatively) requires a Carbon application with a resource fork. Playing with the wxWidgets distribution, I discovered that it is quite easy and transparent to make such a Carbon app from (I guess) any command line application. When applied to the R executable called
2009 Apr 28
1
[macosx] improving quartz & Aqua Tk behaviour outside of RGui
Hello, On Mac OS X, certain Aqua/Quartz UI functionality requires an application to be launched from within an app bundle, or (alternatively) requires a Carbon application with a resource fork. Playing with the wxWidgets distribution, I discovered that it is quite easy and transparent to make such a Carbon app from (I guess) any command line application. When applied to the R executable called
2001 Oct 05
1
nls() fit to a lorentzian - can I specify partials?
First, thanks to all who helped me with my question about rescaling axes on the fly. Using unlist() and range() to set the axis ranges in advance worked well. I've since plotted about 300 datasets with relative ease. Now I'm trying to fit a lossy oscillator resonance to (the square root of) a lorentzian (testframe$y is oscillator amplitude, testframe$x is drive frequency): lorentz
2008 May 11
2
instabilities in wxRuby 1.9.6
I have recently started to use wxRuby, because I have used the wxWidgets library from C++ for a few years and found it an excellent toolkit. I am using Ubuntu 8.04 and version 1.9.6 of wxRuby. A problem though is a number of instabilities. This may be due to my own ignorance, but I have usually found C++/wxWidgets, once the program compiles it will at least stay working, if at times
2011 Aug 25
1
change values in a character vector
Greetings! I have a 127 long vector with all different character entries. I need to generate another vector that is 6 times a long and the second one and has the following structure: NA "foo" "a unique string" NA "bar" "blah" NA "foo" "another unique string" NA "bar" "blah" ..... This has to be repeated 127
2004 Jun 02
13
wxGrid Question
When operating with a wxGrid is there a way to get a reference to the TextCtrl field that is created when you start typing in a cell. Also is there a way to get mouse events to work with a wxGrid, so far I can''t get any of them to work. I had tried various combo''s of: @grid.evt_left_down(){ |event| puts "Left mouse is down"; } using evt_left_down, evt_left_up,
2011 Jan 13
1
s3 methods on S4 objects
I have J Chambers wonderful text ( Software for data Analysis) and I've been trying my hand at some very routine S4 OOP development. One of the things I was trying to do was to create some very basic S4 classes. The first was simply a class that had a data.frame as part of its representation. setClass("df",representation(dirframe="data.frame")) The object basically
2005 Jul 28
1
Displaying p-values in latex
Hi. I want to create a table in latex with regression coefficients and their corresponding p-values. My code is below. How do I format the p-values so that values less than 0.0001 are formated as <.0001 rather than just rounded to 0.0000? Thank you. model<-lm(y~x1+x2) output<-summary(model) output<-as.matrix(coefficients(output)) output<-format.df(ouput,cdec=c(2,2,2,4))
2007 Sep 26
1
rpart error: "Error in dimnames(X)"
I'm using rpart to fit a tree using a large dataset: 7000 observations, 4651 variables. All but one of the variables (age) are binary. When I run the code: fit1 <- rpart(lowergi ~ ., data=dset,method="class") I get the error: Error in dimnames(X) <-list(dn[1L]], unlist(collabs, use.names=FALSE)) : Length of `dimnames' [2] not equal to array extent I have no idea
2005 Aug 16
1
Overall Legend
Hello. I am using R version 2.1.1 on Windows 2000. I am using a par(mfrow=c(2,2)) statement to produce 4 plots on one screen. I want a single horizontal legend to appear at the top of the four plots. My code is something like this: par(mfrow=c(2,2)) plot(x,y1) lines(x,y2) lines(x,y3) plot(x,z1) lines(x,z2) lines(x,z3) plot(x,t1) lines(x,t2) lines(x,t3) plot(x,w1) lines(x,w2) lines(x,w3)