Displaying 20 results from an estimated 3000 matches similar to: "IFELSE function XXXX"
2012 Jan 19
2
Reading in tab (and space) delimited data within a script XXXX
Hello everyone,
I use Bob Muenchen's approach for reading in "in-stream" (to use SAS
parlance) delimited data within a script. This works great:
mystring <-
"id,workshop,gender,q1,q2,q3,q4
1,1,f,1,1,5,1
2,2,f,2,1,4,1
3,1,f,2,2,4,3
4,2, ,3,1, ,3
5,1,m,4,5,2,4
6,2,m,5,4,5,5
7,1,m,5,3,4,4
8,2,m,4,5,5,5"
mydata <- read.table( textConnection(mystring),
2013 Jun 10
4
Combining CSV data
Hello R community,
I am trying to combine two CSV files that look like this:
File A
Row_ID_CR, Data1, Data2, Data3
1, aa, bb, cc
2, dd, ee, ff
File B
Row_ID_N, Src_Row_ID, DataN1
1a, 1, This is comment 1
2a, 1, This is comment 2
3a,
2009 Nov 12
2
redundant factor levels after subsetting a dataset
#I have a data frame with a numeric and a character variable.
x=c(1,2,3,2,0,2,-1,-2,-4)
md=c(rep("Miller",3), rep("Richard",3),rep("Smith",3))
data1=data.frame(x,md)
#I subset this data.frame in a way such that one level of the character
variable does not appear in the new dataset.
data2=data1[x>0,]
data3=subset(data1,x>0)
#However, when I check the levels
2008 May 14
4
Accessing items in a list of lists
Using R 2.6.2, say I have the following list of lists, "comb":
data1 <- list(a = 1, b = 2, c = 3)
data2 <- list(a = 4, b = 5, c = 6)
data3 <- list(a = 3, b = 6, c = 9)
comb <- list(data1 = data1, data2 = data2, data3 = data3)
So that all names for the lowest level list are common. How can I most
efficiently access all of the sublist items "a" indexed by the outer
2008 Jan 15
1
how to fit model to split data and get residual plots
I have a data set with the following structure (with many more obs.):
var1 expt day diameter
1 1 2 0.5
1 1 3 0.9
1 1 4 1.3
1 1 5 1.7
1 2 2 0.3
1 2 3 0.5
1 2 4 0.9
1 2 5 1.6
2 1 2 0.7
2 1 3 1.2
2 1 4 1.6
2 1 5 2.3
2 2 2 0.4
2 2 3 0.8
2 2 4 1.6
2 2 5 3.2
I can get separate regression analysis for each level of var1 and expt
with the command:
by(data3, data3$var1:data3$expt, function(x)
2000 Sep 20
1
'fixing' list components
I have a list x (say) that will contain many inputs to and outputs a model.
x$input1 <- assign.input1(parameter1, parameter2)
is one way to assign input1, but it would be neater to be able to do
assign.input1(x, parameter1, parameter2)
Is this a good idea? If so, what is a good way to do it?
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing
2002 Dec 05
1
Passing options as lists
Hi,
I apologize if this has previously been posted. I've just subscribed to the
R-help digest.
I'm writing a plotting function that uses layout() to plot several different
plots on the same device. This function uses plot(), image(), and a custom
function that uses text(). Each cell of the layout needs different par()
parameters, so what I'd like to do is pass them as lists:
2009 Jun 03
1
Still can't find missing data - How do I get NA in xtabs with factors?
The problem here is Table doesn't seem to have a way to weigh the data.
> ToyData
Data1 Data2 Data3 Weight
101 Sam Red Banana 1.1
102 Sam Green Banana 2.1
103 Sam Blue Orange 2.1
104 Fred Red Orange 2.1
105 Fred Green Guava 2.1
106 Fred Blue Guava 2.1
107 <NA> Red Pear 50.1
108 <NA> Green Pear 50.1
109 <NA> Blue
2012 Oct 03
2
Creating tiff with 1200 dpi
Hi all,
I am trying to create images in R suitable for journal publication. I'd
like to make an image that is 3.6" wide and 5.08" length, and 1200 dpi.
When I create a tiff file that is 800 dpi and 4x4", it works (although
doesn't look good).
But when I create a tiff that is the size and dpi I want, it doesn't
work. I get the following error:
Error in tiff(filename =
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers
#I have a data panel of thousands of firms, by year and industry and
#one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not
#and another variable the represents the firm dimension (total assets in thousand of euros)
#I need to create two separated samples with the same number os firms where
#one firm in the first have a corresponding
2007 Jun 05
2
.activate() behaviour
Hi all,
I''m trying to understand why the following code doesnt work...
----------------------------------------------------------------------------------------
<html>
<head>
<title>blabla</title>
<script type="text/javascript" src="prototype.js"></script>
</head>
<body>
<form action="bllalba">
2006 Oct 06
1
transactions not work for array?
Hi,
I have a transaction block as follow:
begin
Hello.transaction(input1,input2)
input1.save
for i in 0 to count
input2[i].input1_id = input1.id
input2[i].save
end
end
rescue
end
I have used validates_uniqueness_of for input2 in the model
The problem is, when there is duplicate record in input2, input1 and the
first record in input2
2019 Mar 28
2
NFSv4: Using fsid=0 but *not* exporting the root filesystem
Hi,
I would like to use the NFSv4 ability to create a "root" filesystem with
fsid=0, so that I don't have to refer to the whole path of the exported
filesystem when I mount it. However I do *not* want this root
filesystem to be mountable by any host. Is that possible and how?
E.g
Filesystem:
/exports/data1
/exports/data2
/exports/data3
/etc/exports:
/exports
2005 Feb 16
5
scaling axes when plotting multiple data sets
1) When adding additional data sets to a plot using "plot" followed by "lines",
is there a way to automate the scaling of the axes to allow for all data sets
to fit within the plot area?
2) I attempted to solve this by setting
xlim=c(min(c(data1,data2,data3)),max(c(data1,data2,data3)))
however, there are some NAs and Infs in these data sets, and min(data1) and
max(data1) both
2010 May 29
3
[LLVMdev] Vectorized LLVM IR
Le 29 mai 2010 à 01:08, Bill Wendling a écrit :
> Hi Stéphane,
>
> The SSE support is the LLVM backend is fine. What is the code that's generated? Do you have some short examples of where LLVM doesn't do as well as the equivalent scalar code?
>
> -bw
>
> On May 28, 2010, at 12:13 PM, Stéphane Letz wrote:
We are actually testing LLVM for the Faust language
2017 Mar 15
2
Data structure improvement for the SLP vectorizer
Maybe it would illustrative to give an IR example of the case I'm
interested in. Consider
define void @"julia_transform_bvn_derivs_hessian!"(double* %data,
double* %data2, double *%data3, double *%out) {
%element11 = getelementptr inbounds double, double* %data, i32 1
%load10 = load double, double* %data
%load11 = load double, double* %element11
%element21 =
2010 May 29
0
[LLVMdev] Vectorized LLVM IR
On Sat, May 29, 2010 at 12:42 AM, Stéphane Letz <letz at grame.fr> wrote:
>
> Le 29 mai 2010 à 01:08, Bill Wendling a écrit :
>
>> Hi Stéphane,
>>
>> The SSE support is the LLVM backend is fine. What is the code that's generated? Do you have some short examples of where LLVM doesn't do as well as the equivalent scalar code?
>>
>> -bw
>>
2016 Dec 01
2
cannot access to linux share from windows
Now I have this config on the f25 desktop and restarted the smb service but
I still have the same problem.
# net conf list
[global]
workgroup = MYDOMAIN
realm = MYDOMAIN
netbios name = F25SERVER
server string = Samba Server Version %v
kerberos method = dedicated keytab
dedicated keytab file = FILE:/etc/samba/samba.keytab
log file = /var/log/samba/log.%m
2006 Nov 24
1
barplot help needed
hello,
I would like to create the following barplot:
I have 4 different data sets (same length + stddev for each data point)
data1
sd1
data2
sd2
data3
sd3
data4
sd4
now, I'd like to plot in the following way:
data1[1],data2[1],data3[1],data4[1] with it's sd-values side-by-side at
one x-axis label (named "position 1") and each bar in different colors.
2011 Nov 18
1
couting events by subject with "black out" windows
I large datset that includes subjects(ID), Dates and events that need to be counted. Not every date includes an event, and I need to only count one event per 30days, per subject. So in essence, I need to create a 30-day "black out" period during which time an event cannot be "counted" for each subject. The reason is that a rule has been set up, whereby a subject can only be