Displaying 20 results from an estimated 600 matches similar to: "Issues reshaping data"
2012 Mar 23
1
how to cluster rows of words in a text file
Hi:
I am trying to cluster the rows of a text file with kmeans:
I load the data as follows
file1 <- read.csv("somefile.csv")
and the file can be viewed having the following line of words
> file1
1 word1 word3 word4 word1
2 word1 word4 word3 word1
3 word4 word2 word4 word3
4 word4 word2 word1 word3
5 word2 word2 word4 word2
file_as_matrix <- as.matrix(file1);
Now,
2011 Aug 25
1
Combining a greek letter and a newline on the same label
Hi,
I would like to add a two-lines label consisting of:
"Delta word1\n
word2"
(with Delta being the actual greek letter).
However, when I try "expression(paste(Delta,"word1\nword2"))", I obtain the
following display:
"word1\n
Delta word2".
Do you have any idea on how to obtain the desired display?
Thank you for your help!
Sebastien
[[alternative HTML
2009 Nov 03
3
re ading tokens
Greetings,
I am not familiar with processing text in R. Can someone tell me how to
read each line of words as separate elements in a list?
FE, I would like to turn:
word1 word2 word3
word2 word4
into a list of length two with three character elements in the first list
and two elements in the second. I know that this should be easy, but I am a
little confused by the text functions.
Thanks in
2010 Dec 30
1
recursively count the words occurrence in the text files
I just can't google for it:
I'm searching for a "bash" "one liner" (awk, perl, or anything) for this:
there are text files, in several directories:
mkdir one
mkdir two
mkdir three
echo "word1 word2 word3" > one/asf.txt
echo "word2 word4, word5" > one/asfcxv saf.txt
echo "word1. word2" > one/dsgsdg.txt
echo "word6,
2011 Sep 26
2
findAssocs()
I am trying to find the math behind the "tm" package findAssocs()
?findAssocs does not say anything besides "association" and "correlate"
Usually entering "findAssocs" at the CLI gives the code for a R
function, but in this case I obtain:
function (x, term, corlimit)
UseMethod("findAssocs", x)
<environment: namespace:tm>
Any ideas?
2006 May 28
2
Word97 launches but still cannot save or load
Dear friends:
Thanks to Ekkehard, I found out how to launch Word97. I went to
the .wine/drive_c directory and then (using quotes around "Program Files"
and "Microsoft Office") I cd's to where Winword.exe was and then typed,
within this subdirectory: wine WINWORD.EXE. That launched Word97 at last.
But when I try to save a document, all I get is the first letter of the file
2009 Aug 16
1
Can a variable name include '_' or '.' in portable R code
Hi,
It says in R-intro.pdf, "For portable R code (including that to be
used in R packages) only A?Za?z0?9 should be used." I'm an wondering
why '_' and '.' can be used in portable R code.
It very common that some variable name should be composed of two or
more English words. Can somebody let me know what is the widely
accepted practice to concatenate two English
2007 Jul 07
2
Extending/Modifying QueryParser
Hi,
I''ve implemented synonym searching in my rails application but have
an idea I''d like to implement but can''t figure out how to do. The
idea is that I''d like to give the end user the choice on whether to
search for the synonym of a word or not. Preferably by extending the
query language to parse a construct similar to ''%word1'' and
2013 Apr 10
2
grup function
Hello,
How can i mattch blanks within words, when i have more phrases?
c("Shangh i", "Hello here i am","h llo")
> gsub(" ","a",c("Shangh i", "Hello here i am","h llo"))
[1] "Shanghai" "Helloahereaiaam" "hallo"
I would like to have [1] "Shanghai" "Hello here
2005 Nov 08
0
sorting during xtabs? sorting by "individual" order?
Hey alltogether,
refacturing a package (before it will be released),
I ran across the following problem.
I have two directories with different text files,
I want to read the first and construct a document-term
matrix from it (every term=word in a row, every file in
a column, occurrence frequencies form the values).
The second directory contains different files. It
needs to be read in to also
2010 Apr 04
1
How to add a column to dtm showing a part from directory source?
Hello Experts,
I'm new with R and having troubles doing my graduation project.I have 20
subfolders including almost 20000 txt files.What i need to do is to create a
dtm and add a column to it showing a "class" information of the txt files.
My directory source is like "C:\\R\\20news-18828\\comp.graphics" for the
comp.graphic subfolder.I need to take only
2017 Jul 07
1
How does findAssocs() calculate the correlation value ??
hi:
I want to know the math behind the "tm" package findAssocs().
I have found that someone had asked the question before, and have a good explanation by Rick.
?]http://r.789695.n4.nabble.com/findAssocs-td3845751.html?^
But I still don't understand how to calculate the correlation value between the two vectors.
For example:
# Correlation word2 with word3
2008 Jun 11
5
Similar words
Is there a way to get a list of similar words to the ones a user has
searched for?
So if they search for (in my case) transferaze which has no matches I
can get back an array like this [''transferase''] ?
I know I can just add ~ on the end to make it fuzzy, but what I''d like
is to be able to say "Sorry, no matches for ''transferaze''. Did you
2013 Nov 30
4
Full text search improvements
FTS indexing is something I hear quite often nowadays. I?ve added some hacks to make it work better for some installations, but it?s about time to think about the whole design and how it could be improved for everyone in future. Here are some of my initial thoughts.
Currently Dovecot supports 3 full text search engines: Solr, CLucene and Dovecot Squat. CLucene plugin has various features built
2023 May 19
1
range() for Date and POSIXct could respect `finite = TRUE`
Hi All,
I think there may be some possible confusion about what allowsInf would be
reporting (or maybe its just me :) ) if we did this.
Consider a class "myclass", S3, for starters,
with
setMethod("allowsInf", "myclass", function(obj) FALSE)
Then, what would
myclassthing <- structure(1.5, class = "mything")
myclassthing[1] <- Inf
do. Assumely it
2008 Feb 13
1
can a class have the association has_itself?
is it possible to implement a recursive foreign key association like
that?
i''m writing a vocab app, where i want the vocab table to have an id
and two foreign keys, word1 and word2.
the word table will have an id, a word-string, and a language
i''m trying to do this as follows:
class Vocab < ActiveRecord::Base
belongs_to :word
belongs_to :word
class Word <
2011 May 17
2
reshaping issue
Dear R users,
I have a problem with reshaping data. I know such questions have been asked before, but I can't get it right, neither with the reshape function nor with the melt function.
My dataset has about 407 variables and about 48000 cases.
Each case looks as follows:
V1 v2 v3 v4 v5 v6 v7 x1 y1 x2 y2 .... x200 y200
V1 is unique, v2-v7 are
2009 May 05
1
re shape package - use one cast() instead of many
I have a data set that I'm trying to melt and cast in a specific way using
the reshape package. (I'll use the ff_d dataset from reshape so I don't have
to post a toy data set here. )
Lets say I'm looking for the interaction of treatment with each type of
"variable" in ff_d. Using the command below gets me this. Subject will get a
column and each treatment type by each
2008 Feb 07
1
Problems reshaping data with cast()
Hi,
I'm trying to cast() some data, but keep on getting the following error...
> norm.all.melted.height <- transform(all.melted.height,
+ norm.height = value / ave(value,
SNP, Pool, FUN = max)
+ )
Warning messages:
1: In FUN(X[[147L]], ...) :
no non-missing arguments to max; returning -Inf
2: In FUN(X[[147L]],
2012 Nov 17
3
Reshaping a dataframe
Seems like this should be easy but I'm struggling a bit. How do I rearrange a
data frame to go from the first one to the second shown below ?
State Date lbs
TX 200701 400
TX 200702 650
TX 200703 950
TX 200704 1000
FL 200701 200
FL 200702 300
FL 200703 500
FL 200704 333
NJ 200701 409
NJ 200702 308
NJ 200703 300
NJ 200704 800
Date TX FL NJ
200701 400 200 409
200702 650