Displaying 20 results from an estimated 400 matches similar to: "how to have 'match' ignore no-matches"
2009 Aug 12
4
paste first row string onto every string in column
Hi,
I am trying to edit a data frame such that the string in the first line is
appended onto the beginning of each element in the subsequent rows. The data
looks like this:
> df
V1 V2 V3 V4
1 DPA1* DPA1* DPB1* DPB1*
2 0103 0104 0401 0601
3 0103 0103 0301 0402
.
.
and what I want is this:
>dfnew
V1 V2 V3 V4
1 DPA1* DPA1* DPB1* DPB1*
2 DPA1*0103
2009 Dec 05
4
paste adjacent elements matching string
Hi all,
I would like to combine elements of a vector:
vec <- c("astring", "b", "cstring", "d", "e")
> vec
[1] "astring" "b" "cstring" "d" "e"
such that for every element that contains "string" at the end, it is
combined with the next element, so that I get this:
2009 Aug 12
0
Re : paste first row string onto every string in column
Try this , save your data in C:/
and write this
(data <- read.csv2("c:/jill.csv", sep=","))
(C<-data[1,])
A <- numeric(4)
B <- numeric(4)
for (i in 1 :4){
A[i] <- paste(data[1,i],data[2,i])
B[i] <- paste(data[1,i],data[3,i])
}
A
B
(data1 <- rbind(as.character(A),as.character(B)))
(data2 <- rbind(C,data1))
normaly that gives that
> (data <-
2008 Jun 23
3
One-to-one matching?
Hi folks,
Can anyone suggest an efficient way to do "matching without
replacement", or "one-to-one matching"? pmatch() doesn't quite provide
what I need...
For example,
lookupTable <- c("a","b","c","d","e","f")
matchSample <- c("a","a","b","d")
##Normal match()
2008 Jan 24
2
boxplot axis labelling
Hi,
i'm very new to R, so sorry for what i'm sure is a very basic question. I'm
producing a boxplot with the data below:
df3<-data.frame(
x=c(10,11,115,12,13,14,16,17,18,21,22,23,24,26,27,28,29,3,30,32,33,34,35,4,4
1,45,5,50,52,56,58,6,67,6738,68,7,8,9),
fq=c(8,11,1,2,4,4,2,2,6,3,4,2,2,1,1,1,4,51,3,1,1,1,1,35,1,1,19,2,1,1,1,14,1,
1,1,10,13,5),
2013 Jun 05
1
[LLVMdev] TableGen lookup table recipe?
Is it possible to define lookup tables as a list in tablegen, to map one
value to another? Here's the template I was working on:
=========================================
class LookupTable {
list<int> mapping = [0, 8, 16, 24, 32];
}
def LUT : LookupTable;
class MyRegister<name, index> : Register<name> {
let HWEncoding = LUT.mapping[index];
int otherVal = index;
2017 Nov 01
3
Adding Records to a Table in R
Dear R friends,
I am currently working with time series data, and I have a table(as data
frame) that has looks like this (TransitDate are in format = "%e-%B-%Y") :
TransitDate Transits CargoTons
1985-04-01 100 2500
1985-05-01 135 4500
1985-06-01 120 1750
1985-07-01 100 3750
1985-08-01 200
2010 Apr 21
2
Table to List Transformation Scenario
I have a series of tables, one for each environment indicating a date (row)
and a sample at each hour of the day (0 to 23)
Test1 Table:
Date,Hour1,Hour2,...Hour23
1/1/10,123,123,...,123
I would like to model this as a time series but how can I translate the
table into a list such that I can get:
1/1/10 00:00, 123
1/1/10 01:00, 123
1/1/10 02:00, 123
...
1/1/10 23:00, 123
Any suggestions on how
2017 Nov 01
0
Adding Records to a Table in R
Hi Paul,
#First I set up some sample data since I don't have a copy of your data
dtOrig <- as.Date( c("1985-04-01","1985-07-01","1985-12-01","1986-04-01"))
dfOrig <- data.frame( TransitDate=dtOrig, Transits=c(100,100,500,325),
CargoTons=c(1000,1080,3785,4200) )
#Generate the complete set of dates as a data frame
dfDates<- data.frame(
2008 May 03
1
recode involving a count rule
Hello, R-helpers.
I have a data frame below called df. I want to add a variable c, based on
the following logic:
if df$a < 5 then the first two times this condition is met place a 1 in c,
the next two times this condition is met place a 2 in c and when the
condition is not met let c equal df$b. The result would look like, dfnew,
shown below.
a <- rep(c(3,5,7), 4)
b <- rep(c(NA,1,2),
2006 May 03
2
grouped output
hello,
Suppose I have a table that looks like this:
center name email
Health Jon jon@test.com
Health Bob bob@test.com
Admin Jane jan@test.com
Admin Jill jill@test.com
I would like the output to look like this:
Health
Jon jon@test.com
Bob bob@test.com
Admin
Jane jan@test.com
Jill jill@test.com
when i using cold fusion, this was easy via a tag called cfoutput.
when i was using java, this was
2004 Jun 03
2
Force user
Hello list
The Samba Howto Collection repeatedly asserts that by setting the sticky
bit on directories any files created in those directories will be created
with the owner set to that of the directory (for example, see
http://samba.mirror.ac.uk/samba/docs/man/howto/AccessControls.html#id2541262).
This has never worked for me. Files created inherit the group of the
directory, but not the owner.
2013 Apr 09
4
Converting matrix to data frame without losing an assigned dimname
Hello All,
Would like to be able to convert a matrix to a dataframe without losing an assigned dimname.
Here is an example that should illustrate what I'm talking about.
tableData <- state.x77[c(7, 38, 20, 46), c(7, 1, 8)]
names(dimnames(tableData)) <- c("State", "")
tableData
State Frost Population Area
Connecticut 139 3100 4862
2003 Jul 28
5
hi
Guess what
I have no clue what i am doing/ meant to do with R. i have just begun statistics for uni and all commands don't seem to work, they say syntax error, we are meant to put a hist.r in but ? please help, step by step, to use this program i would turn it on (it comes up rgui) is this wrong, have i put the wrong bit on it?
Please help, I am so glad there is an R help
Thankyou
jill
2017 Nov 08
3
Adding Records to a Table in R
Dear Eric,
Hope you are doing great. I also tried the following:
#First I created the complete date sequence
TransitDateFrame <- data.frame(TransitDate=seq(as.Date(dataset1[1,1]),
as.Date(dataset1[nrow(dataset1),1]), by = "month"))
#Then I did the merging
dataset1NEW <- merge(TransitDateFrame, dataset1, by="TransitDate",
all.x=TRUE)
Now it has, as expected the
2010 Feb 17
3
Extending data frame with longer columns
Hi,
I am a beginner in R and have only read a few chapters in the R book,
I was not able to find a solution for this simple problem.
I have an empty data frame:
a=data.frame(name="test")
which I would like to extend in a for-loop (with data extracted from a
database). Ideally I would like to extend the data frame like this:
a["new_1"] = 1:10
a["new_1"] = 1:12
2008 May 16
1
symbolic linking
I have a number directories under /opt on computer jack. I want some (not all)
of them to appear in /opt on computer jill.
I have the /opt directory on jack mounted on jill under /mnt/jack
If I go into the /opt directory on jill and do this:
ln -s /mnt/jack/opt/files .
I get /opt/files/files on jill. What I want is /opt/files and I can't see what
I'm doing wrong.
--
MELVILLE
2004 Feb 18
1
Preview Samba-3 by Example book
Hi All,
I know there has been a lot of interest in John Terpstra's upcoming book,
"Samba-3 by Example: Practical Exercises to Successful Deployment." The book
is scheduled to print end of March and can be found at local bookstores by
early April.
In the meantime, John will be giving a talk at the BYU UNIX User's Group
tomorrow, Thursday, February 19th at 8PM, where he will be
2003 Jun 27
2
No dial Tone but its registering from remote site! Anyone with idea?
Hello Everyone -
Well, I think I'm getting closer with the asterisk connection. This is my
setup and I keep getting this error below in ,my /var/log/asterisk/messages
file. I have opened 5060 port on the firewall box.
I would this is Warning which I can ignore! But I see the connetcion coming
but NO DIAL TONE on mt ata186 box sitting in my 192.168.200.x site!
I'm using ATA186(cisco
2003 Nov 16
3
an object of class lm returned by lm?
Can someone tell me what an object of class lm returned by lm means? I
assumed it mean the regression model - but I'm not sure how to enter
this in. I have tried
y~a+b
but this is not working. I have also tried saving the regression
results and entering these, but again this is incorrect.
This language is from the following:
lm.LMtests(model, listw, zero.policy=FALSE,