similar to: Replace a variable by its value

Displaying 20 results from an estimated 500 matches similar to: "Replace a variable by its value"

2017 Jul 20
2
dynamically create columns using a function
Hi, I am writing a function to dynamically create column names and fill those columns with some basic calculations. My function "demo_fn" takes argument "blup_datacut" and I like to use the contents of those arguments to dynamically create new columns in my dataset. Please note that I have another function called "calc_gg" within the function "demo_fn".
2017 Jul 21
0
dynamically create columns using a function
Hi, I don't know about the lazyeval package or what you are trying to do but to answer the main question "How to create columns dynamically using a function?" I would do something like that: # dataset dem <- structure(list(id = c("L1", "L2", "L3", "M1", "M2", "M3"), TEST_SET_NAME = c("A", "A",
2009 Nov 30
1
RSQLite does not read very large values correctly
Hello, I am trying to import data from an SQLite database to R. Unfortunately, I seem to get wrong data when I try to import very large numbers. For example: I look at the database via SQLiteStudio(v.1.1.3) and I see the following values: OrderID Day TimeToclose 1 2009-11-25 29467907000 2 2009-11-25 29467907000 3 2009-11-25 29467907000 Now I run this R Code: >
2011 Aug 01
2
Errors, driving me nuts
Greetings all, I am getting this error that is driving me nuts... (not a long trip, haha) I have a set of files and in these files I want to calculate ttests on rows 'compareA' and 'compareB' (these will change over time there I want a variable here). Also these files are in many different directories so I want a way filter out the junk... Anyway I don't believe that this is
2009 Jul 29
3
how to skip a numeric column for averaging other columns?
Data has the first row for variable name and the first column for sample name. I want to take "Log" for all data, but how to compute without the first column for sample name. That is, column 1: sample ID column 2-10: data I want to find an average on each column (2-10) > apply(raw_data,2,mean) Error in Math.data.frame(list(sample_id = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, :
2013 Apr 16
4
Singular design matrix in rq
Quantreggers: I'm trying to run rq() on a dataset I posted at: https://docs.google.com/file/d/0B8Kij67bij_ASUpfcmJ4LTFEUUk/edit?usp=sharing (it's a 1500kb csv file named "singular.csv") and am getting the following error: mydata <- read.csv("singular.csv") fit_spl <- rq(raw_data[,1] ~ bs(raw_data[,i],df=15),tau=1) > Error in rq.fit.br(x, y, tau = tau, ...) :
2007 Jul 27
5
File.stub!
Hi, I''m trying to stub File.open and whenever I do, rspec blows up with the following error message (undefined method `add'' for nil:NilClass), which seems to happen because method __add in class Proxy is calling #add on global $rspec_mocks, which in turn is nil. Can someone explain what I''m doing wrong, as I can''t seem to stub anything out! Here''s
2009 Jul 14
2
How to provide list as an argument for the data.frame()
Hi R -users, i've a table as describe below. I'm reading the numeric value presented in this table to populate a list. #table #============ #X    A    B    C #x1    2    3    4 #x2    5    7    10 #x4    2    3    5 #============ rawData <- read.table("raw_data.txt",header=T, sep="\t") myList=list() counter=0 for (i in c(1:length(rawData$X))) {     print (i)    
1997 Aug 21
2
R-alpha: new class for chisquare tests?
I sort of asked this before, but perhaps not explicitly enough. In my ctest collection, there are several chisquare-based tests. For some of them, it may be useful to also return information on expected (and observed) counts. The question is, how should this be done. Of course, there is no problem adding the corresponding components to the list returned by the functions. However, as these are
2018 Jan 15
5
barplot that displays sums of values of 2 y colums grouped by different variables
I am trying to create a barplot displaying the sums of 2 columns of data grouped by a variable. the data is set up like this: "city" "n" "y" <br> mon 100 200 <br> tor 209 300 <br> edm 98 87 <br> mon 20 76 <br> tor 50 96 <br> edm 62 27 <br> the resulting plot should have city as the x-axis, 2 bars per city, 1 representing
2011 Aug 23
1
NA in last row while reading xlsx file
Hi, I am using this script to read a xlsx file to a data frame: library(xlsx) File <- file.path("d:", "car ", "car95-99.xlsx") B_car <- read.xlsx(File, "raw_data") Car2x <- data.frame(month = B_car$Date,Ch = B_car$Ch.des, lat=B_car$Latitude) The last row in the data.frame is always NA, how can I remove it? Thx. -- View this message in
2007 Apr 17
0
15 commits - libswfdec/jpeg libswfdec/swfdec_bits.c libswfdec/swfdec_edittext.c libswfdec/swfdec_font.c libswfdec/swfdec_image.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c libswfdec/swfdec_shape.c libswfdec/swfdec_sprite.c
libswfdec/jpeg/jpeg.c | 3 +++ libswfdec/swfdec_bits.c | 18 ++++++++++++++++-- libswfdec/swfdec_edittext.c | 3 ++- libswfdec/swfdec_font.c | 30 ++++++++++++++++++++++++------ libswfdec/swfdec_image.c | 30 ++++++++++++++---------------- libswfdec/swfdec_root_sprite.c | 2 +- libswfdec/swfdec_script.c | 19 +++++++++----------
2010 Jul 08
2
random sample from arrays
Hello R users, I'm trying to extract random samples from a big array I have. I have a data frame of over 40k lines and would like to produce around 50 random sample of around 200 lines each from this array. this is the matrix ID xxx_1c xxx__2c xxx__3c xxx__4c xxx__5T xxx__6T xxx__7T xxx__8T yyy_1c yyy_1c _2c 1 A_512 2.150295 2.681759 2.177138 2.142790 2.115344 2.013047
2007 Apr 17
0
Branch 'as' - 17 commits - libswfdec/jpeg libswfdec/swfdec_bits.c libswfdec/swfdec_font.c libswfdec/swfdec_image.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c libswfdec/swfdec_shape.c libswfdec/swfdec_sound.c libswfdec/swfdec_sprite.c
libswfdec/jpeg/jpeg.c | 3 +++ libswfdec/swfdec_bits.c | 18 ++++++++++++++++-- libswfdec/swfdec_font.c | 30 ++++++++++++++++++++++++------ libswfdec/swfdec_image.c | 30 ++++++++++++++---------------- libswfdec/swfdec_root_sprite.c | 2 +- libswfdec/swfdec_script.c | 18 +++++++++--------- libswfdec/swfdec_shape.c | 11 ++++++-----
2007 Mar 21
0
5 commits - README libswfdec/jpeg libswfdec/swfdec_image.c
README | 2 +- libswfdec/jpeg/jpeg.c | 13 +++++++++++++ libswfdec/swfdec_image.c | 30 ++++++++++++++++++++++++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) New commits: diff-tree bbf53a5c2060eadff2632674d2550a09719f41e1 (from parents) Merge: 0f3d2abf794d0f1f69a38c4532c4e273054f4696 b12efb820117b62a7150d13359499678e7dcf31d Author: Debian User
2018 Jan 15
0
barplot that displays sums of values of 2 y colums grouped by different variables
It is not generally advisable to get too fancy with stat functions in ggplot... things can easily get more complicated than ggplot is ready to handle when it comes to calculations. It is better to create data that corresponds directly to the graphical representations you are mapping them to. Read [1] for more on this philosophy. [1] H. Wickham, Tidy Data, Journal of Statistical Software,
2007 Aug 13
0
about REALTIME application
Hi all, In version 1.2, there is a realtime function and it is very easy to use with prefix. exten => s,1,RealTime(table|name|peter|user_) and we can easy get back the value as user_name, user_id, etc. However, I found the the function will be depreciated in 1.4. There is a replacement using application REALTIME. I found that it is very troublesome to use it. ---------from web site---------
2010 Jul 02
0
Powercom driver patch
Hello everybody! I'm trying to use nut-2.4.1 with brand new UPS Powercom Imperial IMD-825AP USB. I've faced a problem that the driver powercom despite specifying type=IMP automatically re-detects the UPS as "KIN" and then interprets raw data incorrectly. The same problem was reported by other Powercom users on the official support forum ( http://forum.pcm.ru ). I suppose the
2012 Aug 01
1
Different results between lda(mass) and spss discriminant analysis
Hi all, I obtained a strage result with LDA (MASS) function in R with NIR data. I tried both CV (leave one out cross validation) and splitting my data in odd (training) and even (prediction) sets. In all the cases the minimum error was near to 0. Due to the strange result, I tried with SPSS IBM software and it give me around 11% of minimum error with and without leave one out cross validation.
2007 Nov 10
1
3 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h
libswfdec/swfdec_image.c | 204 ++++++++++++++++++++++++++--------------------- libswfdec/swfdec_image.h | 11 +- 2 files changed, 123 insertions(+), 92 deletions(-) New commits: commit 54d034a21fa13a6afb4ad788a82b240002def2cf Author: Benjamin Otte <otte at gnome.org> Date: Sun Nov 11 00:21:54 2007 +0100 implement reading from PNG files diff --git a/libswfdec/swfdec_image.c